summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c
blob: 63aecd0f3ed0b34fe84033b7d9c9ae0dbb51cfe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* PR 18050 : bogus warning with -Wsequence-point */
/* { dg-do compile } */
/* { dg-options "-Wsequence-point" } */

struct x
{
  int i;
};
void bar(struct x*, int *);

void foo(struct x *y)
{
  bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */
}

void zz(int a, int *b)
{
  *b = a;
}

void baz(void) {
  int a = 5;
  zz(++a, &a);  /* { dg-bogus "operation on 'a' may be undefined" } */
}