Add "argument pseudo" for incoming arguments to a function.
[smatch.git] / validation / noderef.c
blobd9a4822521b538b18277f97ffad3c9e66deae74d
1 # define __A __attribute__((noderef))
3 struct x {
4 int a;
5 int b;
6 };
8 struct y {
9 int a[2];
12 void h(void)
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;
23 q1 = &p;
24 q2 = &p; /* This should complain */
26 r = &*q;
27 r = q;
28 r = &*(q+1); /* This should NOT complain */
29 r = q+1;
31 r = &xp->a; /* This should NOT complain */
32 r = &xp->b;
33 r = &(*xp).a;
34 r = &(*xp).b;
36 r = &x.a;
37 r = &x.b;
39 r = py->a;
40 r = py->a+1;
41 r = &py->a[0];