• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 typedef unsigned char uint8_t;
2 typedef unsigned short uint16_t;
3 typedef unsigned int uint32_t;
4 typedef unsigned long long uint64_t;
5 
6 struct redundant_packed {
7     uint32_t a;
8     uint32_t b;
9 } __attribute__((packed, aligned(8)));
10 
11 struct redundant_packed_bitfield {
12     uint8_t a[3];
13     uint8_t b0:1;
14     uint8_t b1:1;
15     uint32_t c;
16 } __attribute__((packed, aligned(8)));
17 
18 
19 union redundant_packed_union {
20     uint64_t a;
21     uint32_t b;
22 } __attribute__((packed, aligned(16)));
23 
24 
25 struct inner {
26     uint8_t a;
27 } __attribute__((packed, aligned(2)));
28 
29 struct outer_redundant_packed {
30     struct inner a[2];
31     uint32_t b;
32 } __attribute__((packed, aligned(8)));
33 
34 
35 #pragma pack(2)
36 
37 struct redundant_pragma_packed {
38     uint8_t a;
39     uint16_t b;
40 } __attribute__((aligned(4)));
41 
42 #pragma pack()
43