This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66329] If condition evaluated wrongly for "y&1 == 0" condition
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 29 May 2015 14:57:22 +0000
- Subject: [Bug c++/66329] If condition evaluated wrongly for "y&1 == 0" condition
- Auto-submitted: auto-generated
- References: <bug-66329-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66329
--- Comment #5 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to Mikhail Maltsev from comment #4)
> Clang is more verbose:
>
> ./test.c:4:11: warning: & has lower precedence than ==; == will be evaluated
> first [-Wparentheses]
> x = y & 1 == 1;
> ^~~~~~~~
I think even without the extra notes, clang's message is clearer. Now we only
need to convince a maintainer to approve such a patch.