diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c b/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c new file mode 100644 index 000000000..9ece965d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-2.c @@ -0,0 +1,12 @@ +/* Test -Wpointer-to-int-cast. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-Wpointer-to-int-cast" } */ + +void *p; + +char +f (void) +{ + return (char) p; /* { dg-warning "cast from pointer to integer of different size" } */ +} |