function_hooks: update comment explaining various function hooks
[smatch.git] / validation / packed-bitfield1.c
blobb7b575ce6922357833c40b427249f4a0a05c3808
1 #define __packed __attribute__((packed))
3 struct s {
4 unsigned int f0:1;
5 unsigned int f1:1;
6 unsigned int pad:6;
7 } __packed;
8 _Static_assert(sizeof(struct s) == 1, "sizeof(struct s)");
10 extern struct s g;
12 static int foo(struct s *ptr)
14 int f = 0;
16 f += g.f0;
17 f += g.f1;
19 f += ptr->f0;
20 f += ptr->f1;
22 return f;
26 * check-name: packed-bitfield1