]>
Commit | Line | Data |
---|---|---|
368f75ae | 1 | /* Contributed by Peteran, 12 Jan 2004 */ |
2 | /* GCC extension: Conditionals with Omitted Operands | |
3 | "x ? : y" is same as x ? x : y | |
4 | http://gcc.gnu.org/onlinedocs/gcc-3.3.2/gcc/Conditionals.html#Conditionals | |
5 | */ | |
6 | ||
7 | /*@+boolint -exportlocal@*/ | |
8 | void cond1(void *testme) | |
9 | { | |
10 | int i,j; | |
11 | i = (testme!=0)? : 0; | |
12 | j = (testme!=0)? (testme!=0): 0; | |
13 | } | |
14 | ||
15 | int cond2(void *testme) | |
16 | { | |
17 | return (testme!=0)? : 0; | |
18 | } | |
19 | ||
20 | int cond3(int testme) | |
21 | { | |
22 | return testme? testme: 0; | |
23 | } | |
24 | ||
25 | void test_use_before_definition() { | |
26 | int i; | |
27 | printf("%d\n", i?:0); | |
28 | } |