OSDN Git Service

PR debug/54694
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / pr32207.c
1 /* Test warning for comparison non-null address with null pointer constant. */
2 /* Origin: Pawel Sikora <pluto@agmk.net> */
3 /* { dg-do compile } */
4 /* { dg-options "-Waddress" } */
5 extern void z();
6
7 void f() { if ( z ) z(); } /* { dg-warning "always evaluate as" } */
8 void g() { if ( z != 0 ) z(); } /* { dg-warning "the comparison will always evaluate as 'true'" } */
9 void h() { if ( z != (void*)0 ) z(); } /* { dg-warning "the comparison will always evaluate as 'true'" } */