Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/uninit-20.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Spurious uninitialized variable warnings, from gdb */ |
2 /* { dg-do compile } */ | |
3 /* { dg-options "-O2 -Wuninitialized" } */ | |
4 struct os { struct o *o; }; | |
5 struct o { struct o *next; struct os *se; }; | |
6 void f(struct o *o){ | |
7 struct os *s; | |
8 if(o) s = o->se; | |
9 while(o && s == o->se){ | |
10 s++; // here `o' is non-zero and thus s is initialized | |
11 s == o->se // `?' is essential, `if' does not trigger the warning | |
12 ? (o = o->next, o ? s = o->se : 0) | |
13 : 0; | |
14 } | |
15 } | |
16 | |
17 | |
18 |