[Bug middle-end/17534] New: gcc fails to diagnose suspect expressions that have incompatible bit masks
trt at acm dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 17 14:53:00 GMT 2004
The expressions (z & 2) == 4 and (z | 2) == 4 are always false. When these
appear in programs it is almost always unintended, but gcc fails to warn the user.
An example undiagnosed mistake appears in gcc/gcc/java/parse.y near line 1154
/* Can't have a static initializer in an innerclass */
if ($1 | ACC_STATIC &&
...
The '|' is unlikely to have been intended.
I added a warning for this to "my" gcc years ago, and it works well. I recently
got this warning added to the Java "findbugs" tool
http://findbugs.sourceforge.net/bugDescriptions.html (That took less than a
week, in stark contrast to my experiences with gcc).
I have a patch, but this web form lacks a way to supply it.
--
Summary: gcc fails to diagnose suspect expressions that have
incompatible bit masks
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: trt at acm dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17534
More information about the Gcc-bugs
mailing list