| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-fsyntax-only -fpermissive" } |
| 3 |
|
| 4 |
int foo (int i, void *p) |
| 5 |
{ |
| 6 |
if (i == p) // { dg-warning "9:ISO C.. forbids comparison between pointer and integer" } |
| 7 |
return 0; |
| 8 |
else if (i != p) // { dg-warning "14:ISO C.. forbids comparison between pointer and integer" } |
| 9 |
return 1; |
| 10 |
} |
| 11 |
|
| 12 |
int bar (int i, void *p) |
| 13 |
{ |
| 14 |
if (i < p) // { dg-warning "9:ISO C.. forbids comparison between pointer and integer" } |
| 15 |
return 0; |
| 16 |
else if (i >= p) // { dg-warning "14:ISO C.. forbids comparison between pointer and integer" } |
| 17 |
return 1; |
| 18 |
} |
| 19 |
|
| 20 |
int baz (int i, void *p) |
| 21 |
{ |
| 22 |
if (i <= p) // { dg-warning "9:ISO C.. forbids comparison between pointer and integer" } |
| 23 |
return 0; |
| 24 |
else if (i > p) // { dg-warning "14:ISO C.. forbids comparison between pointer and integer" } |
| 25 |
return 1; |
| 26 |
} |