[PATCH] D66397: [Diagnostics] Improve -Wxor-used-as-pow

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 19 12:34:43 PDT 2019


aaron.ballman added a comment.

In D66397#1635745 <https://reviews.llvm.org/D66397#1635745>, @xbolva00 wrote:

> I think it is too soon to jump and disable all macros. We still catch all motivating cases, it found bugs in Chromium.


I think it's too soon to disable any macros. The workaround for Chromium is trivial and makes the code more clear.

> Chromium's case makes sense but on the other hand, LHS does not make much sense to be a macro. #define TWO 2  and res =   TWO ^ 32? And even for this case, I think the user should rework it to #define TWO 0x2.

I guess I don't see the distinction. If the user should rework `TWO` to be `0x2` when on the LHS, the same holds true for the RHS, to me.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66397/new/

https://reviews.llvm.org/D66397





More information about the cfe-commits mailing list