summaryrefslogtreecommitdiffstats
path: root/gcc/testsuite/gcc.dg/Wpointer-arith.c
blob: d7a19079cc43db8fdc0bddb22508454fd03f904d (plain)
1
2
3
4
5
6
7
8
9
10
/* PR 35058: -Werror= works only with some warnings. */
/* { dg-do compile } */
/* { dg-options "-Werror=pointer-arith" } */
void *a;

void *test(){
  int x=5;
  if(a) a++; /* { dg-error "wrong type argument to increment" } */
  return a+x; /* { dg-error "pointer of type" } */
}
OpenPOWER on IntegriCloud