Some consistency changes to library & headers flags.
[splint-patched.git] / test / stack.c
blobbe41aa0dbbc300c3eb8b6cbb0bea4d9784adc91c
1 int *glob;
3 void stack1 (int **x)
5 int sa[3] = { 0, 1, 2 } ;
6 int loc = 3;
8 glob = &loc;
9 *x = &sa[0];
10 } /* 1. Stack-allocated storage *x reachable from parameter x,
11 2. Stack-allocated storage glob reachable from global glob
14 /*@dependent@*/ int *f (int c)
16 int x = 3;
18 if (c == 0)
20 return &x; /* 3. Stack-allocated storage &x reachable from return value */
22 else
24 int sa[10];
26 sa[0] = 35;
27 sa[2] = 37;
29 if (c == 1)
31 return sa; /* 4. Stack-allocated storage sa reachable ... */
33 else
35 return &sa[0]; /* 5. Stack-allocated storage sa reachable ... */