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
kernel-printf: add printf format %pra for struct range
[smatch.git]
/
validation
/
vla-sizeof.c
blob
43079992c07ed26c54eadf81e1944b060bf2dbc2
1
unsigned long
vla_sizeof0
(
int
size
)
2
{
3
int
a
[
size
];
4
return sizeof
(
a
);
5
}
6
7
unsigned long
vla_sizeof1
(
int
size
)
8
{
9
struct
s
{
10
int
a
[
size
];
11
};
12
return sizeof
(
struct
s
);
13
}
14
15
unsigned long
vla_sizeof2
(
int
size
)
16
{
17
struct
s
{
18
int
a
[
size
];
19
} *
p
;
20
return sizeof
(*
p
);
21
}
22
23
void
*
vla_inc
(
int
size
,
void
*
base
)
24
{
25
struct
s
{
26
int
a
[
size
];
27
} *
p
=
base
;
28
29
++
p
;
30
return
p
;
31
}
32
33
/*
34
* check-name: vla-sizeof.c
35
*
36
* check-known-to-fail
37
*/