root/devel/coccinelle/test/ref-passed-variables-inited.input.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. foo
  2. baz
  3. zob1
  4. zob2
  5. bar0
  6. bar1
  7. bar2
  8. bar3
  9. bar4
  10. bar5
  11. bar6
  12. bar7
  13. bar8
  14. not0
  15. not1
  16. not2

   1 void foo(int *z) {
     /* [previous][next][first][last][top][bottom][index][help] */
   2         return:
   3 }
   4 void baz(int z) {
     /* [previous][next][first][last][top][bottom][index][help] */
   5         return;
   6 }
   7 void zob1(int **z) {
     /* [previous][next][first][last][top][bottom][index][help] */
   8         return;
   9 }
  10 void zob2(int ***z) {
     /* [previous][next][first][last][top][bottom][index][help] */
  11         return;
  12 }
  13 
  14 void bar0(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  15         int i;
  16         foo(&i);
  17         baz(i);
  18 }
  19 
  20 void bar1(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  21         int i;
  22         foo(&i);
  23         foo(&i);
  24 }
  25 
  26 void bar2(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  27         int a = 1, b, c = 3;
  28         foo(&a);
  29         baz(a);
  30         foo(&b);
  31         baz(b);
  32         foo(&c);
  33         baz(c);
  34 }
  35 
  36 void bar3(int *w) {
     /* [previous][next][first][last][top][bottom][index][help] */
  37         int i;
  38         foo(&i);
  39         *w = i;
  40 }
  41 
  42 void bar4(int **w) {
     /* [previous][next][first][last][top][bottom][index][help] */
  43         int i;
  44         foo(&i);
  45         **w = *i;
  46 }
  47 
  48 void bar5(int ***w) {
     /* [previous][next][first][last][top][bottom][index][help] */
  49         int *i;
  50         zob(&i);
  51         ***w = *i;
  52 }
  53 
  54 void bar6(int ***w) {
     /* [previous][next][first][last][top][bottom][index][help] */
  55         int *i;
  56         zob1(&i);
  57         ***w = *i;
  58 }
  59 
  60 void bar7(int ****w) {
     /* [previous][next][first][last][top][bottom][index][help] */
  61         int **i;
  62         zob1(&i);
  63         ****w = **i;
  64 }
  65 
  66 int bar8(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  67         int i;
  68         foo(&i);
  69         return i;
  70 }
  71 
  72 void not0(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  73         int i;
  74         foo(&i);
  75 }
  76 
  77 void not1(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  78         int i;
  79         foo(&i);
  80         i = 1;
  81 }
  82 
  83 /* XXX false positive */
  84 void not2(void) {
     /* [previous][next][first][last][top][bottom][index][help] */
  85         int i;
  86         foo(&i);
  87         *(&i) = 2;
  88 }

/* [previous][next][first][last][top][bottom][index][help] */