diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/Wpointer-arith-1.c')
-rw-r--r-- | gcc-4.9/gcc/testsuite/c-c++-common/Wpointer-arith-1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/Wpointer-arith-1.c b/gcc-4.9/gcc/testsuite/c-c++-common/Wpointer-arith-1.c new file mode 100644 index 000000000..86668ef1b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/c-c++-common/Wpointer-arith-1.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-Wpedantic -Wno-pointer-arith" } */ + +void h(void) +{ + typedef void (*pft) (); + typedef void (ft) (); + + void *pv = 0; + pft pf = 0; + + pv++; + pf++; + + --pv; + --pf; + + pv += 1; + pf += 1; + + pv = pv - 1; + pf = pf - 1; + + sizeof (void); + sizeof (ft); +} |