Some consistency changes to library & headers flags.
[splint-patched.git] / test / outglob.c
blob336027763eeb01a10862848091807af0dfb98991
1 int x1, x2, x3;
3 int g()
5 return x1 + x2 + x3; /* 1. uses x3 before definition */
8 int f()
10 int loc;
12 if (3 > 4)
14 loc = 3;
15 return x1; /* 2, 3, 4. bad --- x1 not defined, x2, x3 not defined */
17 else
19 if (4 > 6)
21 loc = x1; /* 5. x1 not defined */
22 loc = g(); /* 6. bad --- x1, x2 not defined before call (defines x2 and x3) */
23 loc = x3;
25 else if (2 > 3)
27 loc = x3; /* 7. x3 not defined */
28 x1 = 6;
29 x2 = 7;
30 return g();
32 else
34 x1 = 6;
35 x2 = 7;
37 return 12; /* 8. returns with x3 not defined */
41 return 12;
42 /* No errors to report. Previously,
43 [9, 10. returns with x2 and x3 undefined (x1 IS defined on all branches!)]
44 but this is not correct; all branches that can reach the return do define
45 x1, x2 and x3.
49 int h (void)
51 return x1; /* okay */