https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105164

--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
Interestingly, I tried a build of gcc trunk with the new clang-14
and got many cases of this warning.

$ grep "warning:.*Wbitwise-instead-of-logical" mk.out | sort | uniq -c > /tmp/0
$ wc -l /tmp/0
16 /tmp/0
$ cat /tmp/0
      1 :184:13: warning: use of bitwise '&' with boolean operands
[-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/c-family/c-attribs.cc:2384:9: warning: use of
bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/cp/decl.cc:11850:7: warning: use of bitwise '&'
with boolean operands [-Wbitwise-instead-of-logical]
      2 ../../trunk.git/gcc/cp/lex.cc:124:24: warning: use of bitwise '&' with
boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/cp/lex.cc:571:11: warning: use of bitwise '&' with
boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/cp/module.cc:16843:11: warning: use of bitwise '&'
with boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/cp/name-lookup.cc:7528:12: warning: use of bitwise
'&' with boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/cp/parser.cc:883:11: warning: use of bitwise '&'
with boolean operands [-Wbitwise-instead-of-logical]
     51 ../../trunk.git/gcc/function-abi.h:177:13: warning: use of bitwise '&'
with boolean operands [-Wbitwise-instead-of-logical]
     49 ../../trunk.git/gcc/function-abi.h:184:13: warning: use of bitwise '&'
with boolean operands [-Wbitwise-instead-of-logical]
      1
../../trunk.git/gcc/function-abi.h../../trunk.git/gcc/loop-unroll.cc::1841750::1319::
 warning: warning: use of bitwise '&' with boolean operands
[-Wbitwise-instead-of-logical]array index 1 is past the end of the array (which
contains 1 element) [-Warray-bounds]
      1 ../../trunk.git/gcc/gimple-ssa-sprintf.cc:1225:19: warning: use of
bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/gimple-ssa-sprintf.cc:1664:12: warning: use of
bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
      1 ../../trunk.git/gcc/rtl.h:../../trunk.git/gcc/function-abi.h:184:13:
warning: use of bitwise '&' with boolean operands
[-Wbitwise-instead-of-logical]
      1 :../../trunk.git/gcc/rtl.h warning: :use of bitwise '&' with boolean
operands [-Wbitwise-instead-of-logical]1237
      5 ../../trunk.git/gcc/rtl-ssa/internals.inl:436:25: warning: use of
bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]

On the evidence of the source code of gcc, this new clang warning
might be worth implementing in gcc.

Reply via email to