This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
- From: "trt at acm dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2004 18:48:33 -0000
- Subject: [Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
- References: <20041012141538.17946.trt@acm.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From trt at acm dot org 2004-12-08 18:48 -------
I should mention there is a hack for the problem noted in comment #5: do the
temporary truthvalue conversions with warnings suppressed.
That is, change the two instances of
tree t = lang_hooks.truthvalue_conversion (default_conversion ($1.value));
to instead be
tree t;
inhibit_warnings++;
t = lang_hooks.truthvalue_conversion (default_conversion ($1.value));
inhibit_warnings--;
So, this can be "readily made to work" after all. But ugh.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946