Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/Wsequence-point-pr18050.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* PR 18050 : bogus warning with -Wsequence-point */ |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-Wsequence-point" } */ | |
4 | |
5 struct x | |
6 { | |
7 int i; | |
8 }; | |
9 void bar(struct x*, int *); | |
10 | |
11 void foo(struct x *y) | |
12 { | |
13 bar(y++, &y->i); /* { dg-warning "operation on 'y' may be undefined" } */ | |
14 } | |
15 | |
16 void zz(int a, int *b) | |
17 { | |
18 *b = a; | |
19 } | |
20 | |
21 void baz(void) { | |
22 int a = 5; | |
23 zz(++a, &a); /* { dg-bogus "operation on 'a' may be undefined" } */ | |
24 } |