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

Shivam Gupta via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 18 10:21:29 PDT 2023


xgupta added a comment.

In D142609#4510995 <https://reviews.llvm.org/D142609#4510995>, @aaron.ballman wrote:

> 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?

IIUC in this patch I am making more like an NFC change and this could be a separate issue. WDYT @nickdesaulniers? Please review it so we can commit it soon.


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

https://reviews.llvm.org/D142609



More information about the cfe-commits mailing list