d_packed_structs.c revision 1.3
11.3Srillig/* $NetBSD: d_packed_structs.c,v 1.3 2021/01/31 14:57:28 rillig Exp $ */ 21.2Srillig# 3 "d_packed_structs.c" 31.2Srillig 41.1Sjruoho/* packed tests */ 51.1Sjruoho 61.1Sjruohostruct in_addr { 71.1Sjruoho int x; 81.1Sjruoho}; 91.3Srilligstruct ip_timestamp { 101.1Sjruoho char ipt_code; 111.1Sjruoho char ipt_len; 121.1Sjruoho char ipt_ptr; 131.3Srillig unsigned int 141.3Srillig ipt_flg: 4, 151.3Srillig ipt_oflw: 4; 161.1Sjruoho union ipt_timestamp { 171.3Srillig int ipt_time[1]; 181.3Srillig struct ipt_ta { 191.1Sjruoho struct in_addr ipt_addr; 201.1Sjruoho int ipt_time; 211.3Srillig } ipt_ta[1]__packed; 221.3Srillig } ipt_timestamp__packed; 231.1Sjruoho} __packed; 241.1Sjruoho 251.1Sjruohotypedef struct __packed { 261.1Sjruoho int x; 271.1Sjruoho} t; 281.1Sjruoho 291.1Sjruohostruct x { 301.1Sjruoho char c; 311.1Sjruoho long l; 321.1Sjruoho} __packed; 331.1Sjruoho 341.1Sjruohostruct y { 351.1Sjruoho char c; 361.1Sjruoho long l; 371.1Sjruoho}; 381.1Sjruoho 391.1Sjruohoint a[sizeof(struct y) - sizeof(struct x) - 1]; 40