[Bug c/32207] New: inconsistent/missed warnings about address of 'x'.
pluto at agmk dot net
gcc-bugzilla@gcc.gnu.org
Mon Jun 4 16:59:00 GMT 2007
the following testcase express one condition in three different ways.
in fact, gcc produces only two different warnings.
extern void z();
void f() { if ( z ) z(); }
void g() { if ( z != 0 ) z(); }
void h() { if ( z != (void*)0 ) z(); }
t.c: In function 'f':
t.c:2: warning: the address of 'z' will always evaluate as 'true'
t.c: In function 'g':
t.c:3: warning: the address of 'z' will never be NULL
--
Summary: inconsistent/missed warnings about address of 'x'.
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pluto at agmk dot net
GCC target triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32207
More information about the Gcc-bugs
mailing list