diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/Wint-to-pointer-cast-2.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/Wint-to-pointer-cast-2.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/Wint-to-pointer-cast-2.c b/gcc-4.9/gcc/testsuite/c-c++-common/Wint-to-pointer-cast-2.c new file mode 100644 index 000000000..5546abb81 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/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 "cast to pointer from integer of different size" } */ +} |