Warn pointer to signed integer cast for ilp32
[official-gcc.git] / gcc / testsuite / gcc.dg / Wpointer-to-signed-int-cast-1.c
blob5d265d8a28aa2d5e6f209409e6a108267fe0bdba
1 /* Test -Wpointer-to-signed-int-cast - off by default. */
2 /* { dg-do compile { target { int128 && ilp32 } } } */
3 /* { dg-options "-Wpointer-to-signed-int-cast" } */
5 void *p;
7 long
8 foo (void)
10 return (long) p; /* { dg-warning "cast from pointer to signed integer" } */
13 unsigned long
14 bar (void)
16 return (unsigned long) p;