[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended

trt at acm dot org gcc-bugzilla@gcc.gnu.org
Thu Oct 14 15:54:00 GMT 2004


------- Additional Comments From trt at acm dot org  2004-10-14 15:54 -------
> a && 4 in their code meaning a != 0 && 4 !=0

That happens, but when it does `a' is not integer type. I use a gcc with this
warning on a 35Mloc code base. There are currently 4 warnings, all pointing to
real bugs.

This is an excellent warning, it just doesn't fit neatly into the gcc front end.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946



More information about the Gcc-bugs mailing list