2 sample.c:11: Fresh storage x not released before
4 sample.c:5: Fresh storage x created
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 created
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-allocated
76 stack.c:12: Stack-allocated storage glob reachable
78 stack.c:9: Storage glob becomes stack-allocated
81 Finished checking --- 3 code warnings, as expected
83 rstring.c:13: Reference counted storage returned
84 without modifying reference count: r1
86 Finished checking --- 1 code warning, as expected
88 unique.c:7: Parameter 1 (s) to function strcpy is
89 declared unique but may be aliased externally by
92 Finished checking --- 1 code warning, as expected
94 exposure.c:6: Function returns reference to
96 exposure.c:6: Return value exposes rep of
98 exposure.c:6: Released storage e->name reachable
99 from parameter at return point
100 exposure.c:6: Storage e->name released
101 exposure.c:23: Suspect modification of observer
102 name: *name = toupper(*name)
103 exposure.c:22: Storage *name becomes observer
105 Finished checking --- 4 code warnings, as
108 modify.c:4: Undocumented modification of *y: *y = *x
109 modify.c:5: Suspect object listed in modifies of setx
111 modify.c:1: Declaration of setx
113 Finished checking --- 2 code warnings, as expected
115 globals.c:5: Undocumented use of global glob2
116 globals.c:3: Global glob1 listed but not used
118 Finished checking --- 2 code warnings, as expected
120 annotglobs.c:13: Undef global globnum used before
122 annotglobs.c:15: Global storage globname contains 1
123 undefined field when call returns: firstname
124 annotglobs.c:21: Only storage globname.firstname (type
125 char *) derived from killed global is not released
128 Finished checking --- 3 code warnings, as expected
130 Finished checking --- no warnings
132 order.c:11: Expression has undefined behavior (value of
133 right operand modified by left operand): x++ * x
134 order.c:13: Expression has undefined behavior (left operand
135 uses i, modified by right operand): y[i] = i++
136 order.c:14: Expression has undefined behavior (value of
137 right operand modified by left operand):
139 order.c:15: Expression has undefined behavior
140 (unconstrained function mystery used in left operand
141 may set global variable glob used in right operand):
144 Finished checking --- 4 code warnings, as expected
146 order.c:11: Expression has undefined behavior (value
147 of right operand modified by left operand):
149 order.c:13: Expression has undefined behavior (left
150 operand uses i, modified by right operand):
152 order.c:14: Expression has undefined behavior (value
153 of right operand modified by left operand):
156 Finished checking --- 3 code warnings, as expected
158 loop.c:14: Suspected infinite loop. No value used in
159 loop test (x, glob1) is modified by test or loop
161 loop.c:15: Suspected infinite loop. No condition
162 values modified. Modification possible through
163 unconstrained calls: h
165 Finished checking --- 2 code warnings, as expected
167 loop.c:14: Suspected infinite loop. No value used in
168 loop test (x, glob1) is modified by test or loop
171 Finished checking --- 1 code warning, as expected
173 switch.c:11: Fall through case (no preceding break)
174 switch.c:14: Missing case in switch: DEFINITELY
176 Finished checking --- 2 code warnings, as expected
178 noeffect.c:6: Statement has no effect: y == *x
179 noeffect.c:7: Statement has no effect: nomodcall(x)
180 noeffect.c:8: Statement has no effect (possible
181 undected modification through call to
182 unconstrained function mysterycall):
185 Finished checking --- 3 code warnings, as expected
187 noeffect.c:6: Statement has no effect: y == *x
188 noeffect.c:7: Statement has no effect: nomodcall(x)
190 Finished checking --- 2 code warnings, as expected
192 ignore.c:8: Return value (type int) ignored: fi()
193 ignore.c:10: Return value (type bool) ignored: fb()
195 Finished checking --- 2 code warnings, as expected
197 ignore.c:8: Return value (type int) ignored: fi()
199 Finished checking --- 1 code warning, as expected
201 ignore.c:10: Return value (type bool) ignored: fb()
203 Finished checking --- 1 code warning, as expected
205 setChar.c:5: Likely out-of-bounds store: buf[10]
206 Unable to resolve constraint:
208 needed to satisfy precondition:
209 requires maxSet(buf @ setChar.c:5) >= 10
211 Finished checking --- 1 code warning, as expected
213 multiError.c:4: Possible out-of-bounds store: buf[2]
214 Unable to resolve constraint:
215 requires maxSet(buf @ multiError.c:4) >= 2
216 needed to satisfy precondition:
217 requires maxSet(buf @ multiError.c:4) >= 2
219 Finished checking --- 1 code warning, as expected
221 bounds.c:9: Possible out-of-bounds store:
223 Unable to resolve constraint:
224 requires maxSet(str @ bounds.c:9) >=
225 maxRead(getenv("MYENV") @ bounds.c:7)
226 needed to satisfy precondition:
227 requires maxSet(str @ bounds.c:9) >=
228 maxRead(tmp @ bounds.c:9)
229 derived from strcpy precondition: requires
230 maxSet(<parameter 1>) >= maxRead(<parameter
233 Finished checking --- 1 code warning, as expected
235 names.c:1: Name stringreverse is reserved for future
236 library extensions. Functions that begin with
237 "str" and a lowercase letter may be added to
238 <stdlib.h> or <string.h>. (ISO99:7.26.9)
239 names.c:6: Internal identifier looka1ike is not
240 distinguishable from lookalike except by lookalike
242 names.c:5: Declaration of lookalike
243 names.c:10: Variable x shadows outer declaration
244 names.c:3: Previous declaration of x: int
246 Finished checking --- 3 code warnings, as expected
248 returned.c:25: New fresh storage (type intSet) passed
249 as implicitly temp (not released): intSet_new()
251 Finished checking --- 1 code warning, as expected