This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcc/70800] libgcc/config/libbid/bid_binarydecimal.c: suspicious comparison ?
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 06 Jul 2017 16:40:52 +0000
- Subject: [Bug libgcc/70800] libgcc/config/libbid/bid_binarydecimal.c: suspicious comparison ?
- Auto-submitted: auto-generated
- References: <bug-70800-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70800
--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
I just discovered that clang++ can be made to find this bug by
adding flag -Wtautological-compare.
jan22a.cc:6:17: warning: bitwise comparison always
evaluates to false [-Wtautological-compare]
if ((n & 0x30) == 1)
~~~~~~~~~~~^~~~