This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32207] New: inconsistent/missed warnings about address of 'x'.
- From: "pluto at agmk dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jun 2007 16:59:48 -0000
- Subject: [Bug c/32207] New: inconsistent/missed warnings about address of 'x'.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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