gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / pr32207.c
blobcf9bef8099a29fd588b868669aa6115ae9b80368
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();
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'" } */