Partially implement -Wdeprecated-declarations.
[cparser] / parsetest / cp_error039.c
1 #pragma pack(push,2)
2 typedef struct teststruct {
3         char a;
4         int b;
5 } teststruct_t;
6 #pragma pack(pop)
7
8 typedef struct teststruct2 {
9         char a;
10         int b;
11 } teststruct2_t;
12
13 int main(void)
14 {
15         struct teststruct t;
16         struct teststruct2 t2;
17
18         memset(&t, 0, sizeof(t));
19         t.a = 0xEF;
20         t.b = 0x12345678;
21
22         memset(&t2, 0, sizeof(t2));
23         t2.a = 0xEF;
24         t2.b = 0x12345678;
25
26         printf("%.8X %.2X %.8X %.2X\n", *(unsigned int *) &t,
27                 (unsigned int) *((unsigned char *) &t + 4),
28                 *(unsigned int *) &t2,
29                 (unsigned int) *((unsigned char *) &t2 + 4));
30
31         return 0;
32 }