gcc/testsuite/gcc.dg/Wincompatible-pointer-types-3.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-std=c90 -pedantic-errors" } */ |
| 3 | |
| 4 | void * |
| 5 | f1 (int flag, int *a, long *b) |
| 6 | { |
| 7 | return flag ? a : b; /* { dg-error "pointer type mismatch in conditional expression \\\[-Wincompatible-pointer-types\\\]" } */ |
| 8 | /* { dg-note "first expression has type 'int \\*'" "" { target *-*-* } .-1 } */ |
| 9 | /* { dg-note "second expression has type 'long int \\*'" "" { target *-*-* } .-2 } */ |
| 10 | } |