Release coccinelle-0.2.0rc1
[bpt/coccinelle.git] / scripts / coccicheck / cocci / noderef.cocci
1 //
2 // sizeof argument must be return the size of the
3 // data, no the size of the pointer to it.
4 //
5
6 virtual org, patch, diff
7
8 @ depends on patch && !org && !diff expression@
9 expression *x;
10 @@
11
12 x =
13 <+...
14 -sizeof(x)
15 +sizeof(*x)
16 ...+>
17
18 @ depends on !patch && !org && diff expression@
19 expression *x;
20 @@
21
22 x =
23 <+...
24 *sizeof(x)
25 ...+>
26
27 @r depends on !patch && org && !diff expression @
28 expression *x;
29 position p;
30 @@
31
32 x = <+... sizeof(x@p) ...+>
33
34 @script:python@
35 x << r.x;
36 p << r.p;
37 @@
38
39 cocci.print_main(x, p)