[PATCH] D108003: [Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects

Nathan Chancellor via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 14 18:03:19 PDT 2021


nathanchance added a comment.

I have sent the following patches for the Linux kernel. These were the only instances of the warning that I found across the code base in all of the configurations that we usually test so thank you for the heads up so I could send fixes before this lands.

https://lore.kernel.org/r/20210814234248.1755703-1-nathan@kernel.org/
https://lore.kernel.org/r/20210814235625.1780033-1-nathan@kernel.org/
https://lore.kernel.org/r/20210815004154.1781834-1-nathan@kernel.org/

Is there a reason `-Wbool-operation` is not in `-Wall`? It is with GCC (although now, their `-Wbool-operation` is equivalent to just `Wbool-operation-negation`. I know that is tangential to this patch but if we want to take advantage of this new warning, we will have to explicitly enable `-Wbool-operation` in the kernel's Makefile.


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

https://reviews.llvm.org/D108003



More information about the cfe-commits mailing list