Partially implement -Wdeprecated-declarations.
[cparser] / parsetest / initializers.c
1 int bla = 1;
2 int bla2 = 2;
3 int bla3 = { 3 };
4 int bla4 = { 4, };
5 /* should fail:
6 int bla5 = { { 2 } };
7 int bla6 = { 1, 2 };
8 int *bla7 = { 2, };
9 int bla5 = 1, ;
10 */
11
12 char str1[] = "Hello";
13 char str2[5] = "Hello";
14 char str3[10] = "Hello";
15 signed char str4[] = "Hello";
16 unsigned char str5[] = "Hello";
17 /* char str4[4] = "Hello"; unclear wether this should be an error or warning
18  * gcc produces a warning, icc an error */
19
20 struct foo {
21         int a, b;
22 };
23
24 struct foo f1 = { 1, 2 };
25 struct foo f2 = { { 1,
26                                         }
27                                         , 2 }; /* produces a warning on icc and gcc... */
28 struct foo f3 = { { { 1, } }, 2 }; /* produces a warning on icc and gcc... */
29
30 struct foob {
31         int a;
32         struct foobb {
33                 float c, d;
34         } f;
35         int e;
36 };
37
38 struct foob ff2 = { 1, 2.5, 4.4, 2 };
39
40 union foou {
41         int a;
42         float b;
43 };
44
45 union foou g1 = { 5 };
46
47 int main() {
48         return 0;
49 }