d_packed_structs.c revision 1.3
1/*	$NetBSD: d_packed_structs.c,v 1.3 2021/01/31 14:57:28 rillig Exp $	*/
2# 3 "d_packed_structs.c"
3
4/* packed tests */
5
6struct in_addr {
7	int x;
8};
9struct ip_timestamp {
10	char ipt_code;
11	char ipt_len;
12	char ipt_ptr;
13	unsigned int
14	    ipt_flg: 4,
15	    ipt_oflw: 4;
16	union ipt_timestamp {
17		int ipt_time[1];
18		struct ipt_ta {
19			struct in_addr ipt_addr;
20			int ipt_time;
21		} ipt_ta[1]__packed;
22	} ipt_timestamp__packed;
23} __packed;
24
25typedef struct __packed {
26	int x;
27} t;
28
29struct x {
30	char c;
31	long l;
32} __packed;
33
34struct y {
35	char c;
36	long l;
37};
38
39int a[sizeof(struct y) - sizeof(struct x) - 1];
40