https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69768
Bug ID: 69768
Summary: [6 Regression] Bogus -Waddress warning
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
It looks like ImageMagic compares string literal against NULL but we warn about
this at least in conditional context:
extern void __assert_fail ();
int foo ()
{
("Should not call this function" != (char *) ((void *)0))
? (void) (0) : __assert_fail ();
return 0;
}
> gcc-6 -S t.c -Waddress
t.c: In function ‘int foo()’:
t.c:4:58: warning: comparison with string literal results in unspecified
behaviour [-Waddress]
("Should not call this function" != (char *) ((void *)0))
^
No such warning with GCC 5.