2 sample.c:11: Fresh storage x not released before
4 sample.c:5: Fresh storage x allocated
5 sample.c:5: Variable x declared but not used
7 Finished checking --- 2 code warnings, as expected
9 null.c:3: Dereference of possibly null pointer s: *s
10 null.c:1: Storage s may become null
12 Finished checking --- 1 code warning, as expected
14 Finished checking --- no warnings
16 usedef.c:11: Value *x used before definition
17 usedef.c:13: Passed storage x not completely defined
18 (*x is undefined): getVal (x)
19 usedef.c:15: Passed storage x not completely defined
20 (*x is undefined): mysteryVal (x)
22 Finished checking --- 3 code warnings, as expected
24 usedef.c:11: Value *x used before definition
25 usedef.c:13: Passed storage x not completely defined
26 (*x is undefined): getVal (x)
28 Finished checking --- 2 code warnings, as expected
30 bool.c:6: Test expression for if is assignment expression: i = 3
31 bool.c:6: Test expression for if not bool, type int: i = 3
32 bool.c:7: Return value type bool does not match declared type int: b1
33 bool.c:8: Operand of ! is non-boolean (int): !i
34 bool.c:8: Right operand of || is non-boolean (char *): !i || s
35 bool.c:10: Test expression for if not bool, type char *: s
36 bool.c:12: Use of == with bool variables (risks inconsistency because
37 of multiple true values): b1 == b2
39 Finished checking --- 7 code warnings, as expected
41 palindrome.c:6: Cast from underlying
42 abstract type mstring: (char *)s
43 palindrome.c:7: Function strlen expects arg
44 1 to be char * gets mstring: s
45 palindrome.c:11: Array fetch from non-array
46 (mstring): s[len - i - 1]
47 palindrome.c:19: Function isPalindrome
48 expects arg 1 to be mstring gets char *:
51 Finished checking --- 4 code warnings, as
54 only.c:11: Only storage glob (type int *) not released
55 before assignment: glob = y
56 only.c:1: Storage glob becomes only
57 only.c:11: Implicitly temp storage y assigned to only:
59 only.c:13: Dereference of possibly null pointer m: *m
60 only.c:8: Storage m may become null
61 only.c:13: Variable x used after being released
62 only.c:12: Storage x released
63 only.c:14: Implicitly temp storage z returned as only:
65 only.c:14: Fresh storage m not released before return
66 only.c:9: Fresh storage m allocated
68 Finished checking --- 6 code warnings, as expected
70 stack.c:12: Stack-allocated storage &loc reachable
71 from return value: &loc
72 stack.c:12: Stack-allocated storage *x reachable from
74 stack.c:10: Storage *x becomes stack
75 stack.c:12: Stack-allocated storage glob reachable
77 stack.c:9: Storage glob becomes stack
79 Finished checking --- 3 code warnings, as expected
81 rstring.c:13: Reference counted storage returned
82 without modifying reference count: r1
84 Finished checking --- 1 code warning, as expected
86 unique.c:7: Parameter 1 (s) to function strcpy is
87 declared unique but may be aliased externally by
90 Finished checking --- 1 code warning, as expected
92 exposure.c:6: Function returns reference to
94 exposure.c:6: Return value exposes rep of
96 exposure.c:6: Released storage e->name reachable
97 from parameter at return point
98 exposure.c:6: Storage e->name is released
99 exposure.c:23: Suspect modification of observer
100 name: *name = toupper(*name)
102 Finished checking --- 4 code warnings, as
105 modify.c:4: Undocumented modification of *y: *y = *x
106 modify.c:5: Suspect object listed in modifies of setx
108 modify.c:1: Declaration of setx
110 Finished checking --- 2 code warnings, as expected
112 globals.c:5: Undocumented use of global glob2
113 globals.c:3: Global glob1 listed but not used
115 Finished checking --- 2 code warnings, as expected
117 annotglobs.c:13: Undef global globnum used before
119 annotglobs.c:15: Global storage globname contains 1
120 undefined field when call returns: firstname
121 annotglobs.c:21: Only storage globname.firstname (type
122 char *) derived from killed global is not released
125 Finished checking --- 3 code warnings, as expected
127 Finished checking --- no warnings
129 order.c:11: Expression has undefined behavior (value of
130 right operand modified by left operand): x++ * x
131 order.c:13: Expression has undefined behavior (left operand
132 uses i, modified by right operand): y[i] = i++
133 order.c:14: Expression has undefined behavior (value of
134 right operand modified by left operand):
136 order.c:15: Expression has undefined behavior
137 (unconstrained function mystery used in left operand
138 may set global variable glob used in right operand):
141 Finished checking --- 4 code warnings, as expected
143 order.c:11: Expression has undefined behavior (value
144 of right operand modified by left operand):
146 order.c:13: Expression has undefined behavior (left
147 operand uses i, modified by right operand):
149 order.c:14: Expression has undefined behavior (value
150 of right operand modified by left operand):
153 Finished checking --- 3 code warnings, as expected
155 loop.c:14: Suspected infinite loop. No value used in
156 loop test (x, glob1) is modified by test or loop
158 loop.c:15: Suspected infinite loop. No condition
159 values modified. Modification possible through
160 unconstrained calls: h
162 Finished checking --- 2 code warnings, as expected
164 loop.c:14: Suspected infinite loop. No value used in
165 loop test (x, glob1) is modified by test or loop
168 Finished checking --- 1 code warning, as expected
170 switch.c:11: Fall through case (no preceding break)
171 switch.c:14: Missing case in switch: DEFINITELY
173 Finished checking --- 2 code warnings, as expected
175 noeffect.c:6: Statement has no effect: y == *x
176 noeffect.c:7: Statement has no effect: nomodcall(x)
177 noeffect.c:8: Statement has no effect (possible
178 undected modification through call to
179 unconstrained function mysterycall):
182 Finished checking --- 3 code warnings, as expected
184 noeffect.c:6: Statement has no effect: y == *x
185 noeffect.c:7: Statement has no effect: nomodcall(x)
187 Finished checking --- 2 code warnings, as expected
189 ignore.c:8: Return value (type int) ignored: fi()
190 ignore.c:10: Return value (type bool) ignored: fb()
192 Finished checking --- 2 code warnings, as expected
194 ignore.c:8: Return value (type int) ignored: fi()
196 Finished checking --- 1 code warning, as expected
198 ignore.c:10: Return value (type bool) ignored: fb()
200 Finished checking --- 1 code warning, as expected