| 1 |
/* Ensure the analyzer treats (NULL == &e) as being false for this case, |
| 2 |
where the logic is sufficiently complicated to not be optimized away. */ |
| 3 |
|
| 4 |
#include <stdio.h> |
| 5 |
|
| 6 |
int main() { |
| 7 |
int e = 10086; |
| 8 |
int *f = &e; |
| 9 |
int g = 0; |
| 10 |
int *h[2][1]; |
| 11 |
h[1][0] = f; |
| 12 |
if (g == (h[1][0])) { /* { dg-warning "comparison between pointer and integer" "" { target c } } */ |
| 13 |
/* { dg-error "ISO C\\+\\+ forbids comparison between pointer and integer" "" { target c++ } .-1 } */ |
| 14 |
unsigned int *i = 0; |
| 15 |
} |
| 16 |
printf("NPD_FLAG: %d\n ", *f); |
| 17 |
return 0; |
| 18 |
} |