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