[PATCH] D142609: [Clang] Fix -Wconstant-logical-operand when LHS is a constant

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 08:39:46 PDT 2023


aaron.ballman added a comment.

In D142609#4510596 <https://reviews.llvm.org/D142609#4510596>, @xbolva00 wrote:

> In my opinion it makes sense to adjust that kernel code based on this warning in the current inplementation state.
>
> @aaron.ballman ?

I think that use of macros for any of the constant values in the expression should silence the diagnostic on the assumption that the macro value changes with different configurations and so it's only constant in one configuration mode. Alternatively, I could see an argument to use a different diagnostic group when macros are involved so that users can silence macro-related constant warnings while not losing non-macro cases. WDYT?


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

https://reviews.llvm.org/D142609



More information about the cfe-commits mailing list