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
Add "argument pseudo" for incoming arguments to a function.
[smatch.git]
/
validation
/
noderef.c
blob
d9a4822521b538b18277f97ffad3c9e66deae74d
1
# define __A __attribute__((noderef))
2
3
struct
x
{
4
int
a
;
5
int
b
;
6
};
7
8
struct
y
{
9
int
a
[
2
];
10
};
11
12
void
h
(
void
)
13
{
14
char
__A
*
p
;
15
char
__A
* *
q1
;
16
char
*
__A
*
q2
;
17
struct
x __A
*
xp
;
18
struct
x __A x
;
19
int
__A
*
q
;
20
int
__A
*
r
;
21
struct
y __A
*
py
;
22
23
q1
= &
p
;
24
q2
= &
p
;
/* This should complain */
25
26
r
= &*
q
;
27
r
=
q
;
28
r
= &*(
q
+
1
);
/* This should NOT complain */
29
r
=
q
+
1
;
30
31
r
= &
xp
->
a
;
/* This should NOT complain */
32
r
= &
xp
->
b
;
33
r
= &(*
xp
).
a
;
34
r
= &(*
xp
).
b
;
35
36
r
= &
x
.
a
;
37
r
= &
x
.
b
;
38
39
r
=
py
->
a
;
40
r
=
py
->
a
+
1
;
41
r
= &
py
->
a
[
0
];
42
}