Dávid Bolvanský
|
f62d18ff14
|
[Clang] Extend -Wbool-operation to warn about bitwise and of bools with side effects
Motivation: https://arstechnica.com/gadgets/2021/07/google-pushed-a-one-character-typo-to-production-bricking-chrome-os-devices/
Warn for pattern boolA & boolB or boolA | boolB where boolA and boolB has possible side effects.
Casting one operand to int is enough to silence this warning: for example (int)boolA & boolB or boolA| (int)boolB
Fixes https://bugs.llvm.org/show_bug.cgi?id=51216
Differential Revision: https://reviews.llvm.org/D108003
|
2021-10-03 11:06:40 +02:00 |