PR middle-end/85602 - -Wsizeof-pointer-memaccess for strncat with size of source
[official-gcc.git] / gcc / testsuite / c-c++-common / Waddress-2.c
blob025efda12cb9ab312b16a3e0489dec0070331658
1 /* PR c/47931 - missing -Waddress warning for comparison with NULL
2 { dg-do compile }
3 { dg-options "-Waddress" } */
5 #define NULL ((void *) 0)
7 int i;
9 int f0 (void)
11 return &i != 0; /* { dg-warning "the address of .i. will never be NULL" } */
14 int f1 (void)
16 return &i != (void *) 0; /* { dg-warning "the address of .i. will never be NULL" } */
19 int f2 (void)
21 return &i != NULL; /* { dg-warning "the address of .i. will never be NULL" } */