]> andersk Git - splint.git/blame - test/switch.c
noexpand always false.
[splint.git] / test / switch.c
CommitLineData
885824d3 1int f1(int x)
2{
3 switch (x)
4 {
5 case 0: return 3;
6 case 1: return 4;
7 default: return 6;
8 }
9}
10
11typedef enum _et { ONE, TWO, THREE } et;
12
13int f2 (et x)
14{
15 switch (x)
16 {
17 case ONE: return 3;
18 case TWO: return 8;
19 case THREE: return 12;
20 }
21}
22
23int f3 (et x)
24{
25 switch (x)
26 {
27 case ONE: return 3;
28 case TWO: break;
29 default: return 12;
30 }
31} /* 1. Path with no return in function declared to return int */
32
33int f4 (et x)
34{
35 switch (x)
36 {
37 case ONE: return 3;
38 case TWO: return 14;
39 default: return 12;
40 }
41}
42
43int f5 (et x)
44{
45 switch (x)
46 {
47 case ONE: return 3;
48 case TWO: return 14;
49 } /* 2. Missing case in switch: THREE */
50} /* 3. Path with no return in function declared to return int */
51
52int f6 (et x)
53{
54 switch (x)
55 {
56 case ONE:
57 if (3 > 4)
58 {
59 return 3;
60 }
61 else
62 {
63 return 12;
64 }
65 case TWO:
66 if (3 > 4) break;
67 return 14;
68 default: return 12;
69 }
70} /* 4. Path with no return in function declared to return int */
71
72
73
This page took 0.517146 seconds and 5 git commands to generate.