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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |egallager at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=71852
            Summary|libgcc/config/libbid/bid_bi |libgcc/config/libbid/bid_bi
                   |narydecimal.c: suspicious   |narydecimal.c: suspicious
                   |comparison ?                |comparison ? (missed
                   |                            |-Wtautological-compare)

--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to David Binderman from comment #3)
> 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)
>             ~~~~~~~~~~~^~~~

I think Marek enhanced -Wtautological-compare to catch cases like this, in
which case bug 71852 is related

Reply via email to