repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
function_hooks: update comment explaining various function hooks
[smatch.git]
/
validation
/
packed-bitfield1.c
blob
b7b575ce6922357833c40b427249f4a0a05c3808
1
#define __packed __attribute__((packed))
2
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)"
);
9
10
extern
struct
s g
;
11
12
static int
foo
(
struct
s
*
ptr
)
13
{
14
int
f
=
0
;
15
16
f
+=
g
.
f0
;
17
f
+=
g
.
f1
;
18
19
f
+=
ptr
->
f0
;
20
f
+=
ptr
->
f1
;
21
22
return
f
;
23
}
24
25
/*
26
* check-name: packed-bitfield1
27
*/