]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/netbsd-tests/usr.bin/xlint/lint1/d_packed_structs.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / netbsd-tests / usr.bin / xlint / lint1 / d_packed_structs.c
1 /* packed tests */
2
3 struct in_addr {
4         int x;
5 };
6 struct  ip_timestamp {
7         char ipt_code;
8         char ipt_len;
9         char ipt_ptr;
10         unsigned int ipt_flg:4,
11                      ipt_oflw:4;
12         union ipt_timestamp {
13                  int    ipt_time[1];
14                  struct ipt_ta {
15                         struct in_addr ipt_addr;
16                         int ipt_time;
17                  } ipt_ta[1] __packed;
18         } ipt_timestamp __packed;
19 } __packed;
20
21 typedef struct __packed {
22         int x;
23 } t;
24
25 struct x {
26         char c;
27         long l;
28 } __packed;
29
30 struct y {
31         char c;
32         long l;
33 };
34
35 int a[sizeof(struct y) - sizeof(struct x) - 1];