]> andersk Git - splint.git/blame - test/manual.expect
Updated documentation and Makefiles (LCLint -> splint),
[splint.git] / test / manual.expect
CommitLineData
27c9e640 1
2sample.c:11: Fresh storage x not released before
3 return
4 sample.c:5: Fresh storage x allocated
5sample.c:5: Variable x declared but not used
6
7Finished checking --- 2 code warnings, as expected
8
9null.c:3: Dereference of possibly null pointer s: *s
10 null.c:1: Storage s may become null
11
12Finished checking --- 1 code warning, as expected
13
14Finished checking --- no warnings
15
16usedef.c:11: Value *x used before definition
17usedef.c:13: Passed storage x not completely defined
18 (*x is undefined): getVal (x)
19usedef.c:15: Passed storage x not completely defined
20 (*x is undefined): mysteryVal (x)
21
22Finished checking --- 3 code warnings, as expected
23
24usedef.c:11: Value *x used before definition
25usedef.c:13: Passed storage x not completely defined
26 (*x is undefined): getVal (x)
27
28Finished checking --- 2 code warnings, as expected
29
30bool.c:6: Test expression for if is assignment expression: i = 3
31bool.c:6: Test expression for if not bool, type int: i = 3
32bool.c:7: Return value type bool does not match declared type int: b1
33bool.c:8: Operand of ! is non-boolean (int): !i
34bool.c:8: Right operand of || is non-boolean (char *): !i || s
35bool.c:10: Test expression for if not bool, type char *: s
36bool.c:12: Use of == with bool variables (risks inconsistency because
37 of multiple true values): b1 == b2
38
39Finished checking --- 7 code warnings, as expected
40
41palindrome.c:6: Cast from underlying
42 abstract type mstring: (char *)s
43palindrome.c:7: Function strlen expects arg
44 1 to be char * gets mstring: s
45palindrome.c:11: Array fetch from non-array
46 (mstring): s[len - i - 1]
47palindrome.c:19: Function isPalindrome
48 expects arg 1 to be mstring gets char *:
49 "bob"
50
51Finished checking --- 4 code warnings, as
52expected
53
54only.c:11: Only storage glob (type int *) not released
55 before assignment: glob = y
56 only.c:1: Storage glob becomes only
57only.c:11: Implicitly temp storage y assigned to only:
58 glob = y
59only.c:13: Dereference of possibly null pointer m: *m
60 only.c:8: Storage m may become null
61only.c:13: Variable x used after being released
62 only.c:12: Storage x released
63only.c:14: Implicitly temp storage z returned as only:
64 z
65only.c:14: Fresh storage m not released before return
66 only.c:9: Fresh storage m allocated
67
68Finished checking --- 6 code warnings, as expected
69
70stack.c:12: Stack-allocated storage &loc reachable
71 from return value: &loc
72stack.c:12: Stack-allocated storage *x reachable from
73 parameter x
74 stack.c:10: Storage *x becomes stack
75stack.c:12: Stack-allocated storage glob reachable
76 from global glob
77 stack.c:9: Storage glob becomes stack
78
79Finished checking --- 3 code warnings, as expected
80
81rstring.c:13: Reference counted storage returned
82 without modifying reference count: r1
83
84Finished checking --- 1 code warning, as expected
85
86unique.c:7: Parameter 1 (s) to function strcpy is
87 declared unique but may be aliased externally by
88 parameter 2 (t)
89
90Finished checking --- 1 code warning, as expected
91
92exposure.c:6: Function returns reference to
93 parameter e: e->name
94exposure.c:6: Return value exposes rep of
95 employee: e->name
96exposure.c:6: Released storage e->name reachable
97 from parameter at return point
98 exposure.c:6: Storage e->name is released
99exposure.c:23: Suspect modification of observer
100 name: *name = toupper(*name)
101
102Finished checking --- 4 code warnings, as
103expected
104
105modify.c:4: Undocumented modification of *y: *y = *x
106modify.c:5: Suspect object listed in modifies of setx
107 not modified: *x
108 modify.c:1: Declaration of setx
109
110Finished checking --- 2 code warnings, as expected
111
112globals.c:5: Undocumented use of global glob2
113globals.c:3: Global glob1 listed but not used
114
115Finished checking --- 2 code warnings, as expected
116
117annotglobs.c:13: Undef global globnum used before
118 definition
119annotglobs.c:15: Global storage globname contains 1
120 undefined field when call returns: firstname
121annotglobs.c:21: Only storage globname.firstname (type
122 char *) derived from killed global is not released
123 (memory leak)
124
125Finished checking --- 3 code warnings, as expected
126
127Finished checking --- no warnings
128
129order.c:11: Expression has undefined behavior (value of
130 right operand modified by left operand): x++ * x
131order.c:13: Expression has undefined behavior (left operand
132 uses i, modified by right operand): y[i] = i++
133order.c:14: Expression has undefined behavior (value of
134 right operand modified by left operand):
135 modglob() * glob
136order.c:15: Expression has undefined behavior
137 (unconstrained function mystery used in left operand
138 may set global variable glob used in right operand):
139 mystery() * glob
140
141Finished checking --- 4 code warnings, as expected
142
143order.c:11: Expression has undefined behavior (value
144 of right operand modified by left operand):
145 x++ * x
146order.c:13: Expression has undefined behavior (left
147 operand uses i, modified by right operand):
148 y[i] = i++
149order.c:14: Expression has undefined behavior (value
150 of right operand modified by left operand):
151 modglob() * glob
152
153Finished checking --- 3 code warnings, as expected
154
155loop.c:14: Suspected infinite loop. No value used in
156 loop test (x, glob1) is modified by test or loop
157 body.
158loop.c:15: Suspected infinite loop. No condition
159 values modified. Modification possible through
160 unconstrained calls: h
161
162Finished checking --- 2 code warnings, as expected
163
164loop.c:14: Suspected infinite loop. No value used in
165 loop test (x, glob1) is modified by test or loop
166 body.
167
168Finished checking --- 1 code warning, as expected
169
170switch.c:11: Fall through case (no preceding break)
171switch.c:14: Missing case in switch: DEFINITELY
172
173Finished checking --- 2 code warnings, as expected
174
175noeffect.c:6: Statement has no effect: y == *x
176noeffect.c:7: Statement has no effect: nomodcall(x)
177noeffect.c:8: Statement has no effect (possible
178 undected modification through call to
179 unconstrained function mysterycall):
180 mysterycall(x)
181
182Finished checking --- 3 code warnings, as expected
183
184noeffect.c:6: Statement has no effect: y == *x
185noeffect.c:7: Statement has no effect: nomodcall(x)
186
187Finished checking --- 2 code warnings, as expected
188
189ignore.c:8: Return value (type int) ignored: fi()
190ignore.c:10: Return value (type bool) ignored: fb()
191
192Finished checking --- 2 code warnings, as expected
193
194ignore.c:8: Return value (type int) ignored: fi()
195
196Finished checking --- 1 code warning, as expected
197
198ignore.c:10: Return value (type bool) ignored: fb()
199
200Finished checking --- 1 code warning, as expected
f8f5727a 201
202setChar.c:5: Possible out-of-bounds store:
203 buf[10]
204 Unable to resolve constraint:
205 requires 9 >= 10
206 needed to satisfy precondition:
207 requires maxSet(buf @ setChar.c:5) >= 10
208
209Finished checking --- 1 code warning, as expected
210
211multiError.c:4: Possible out-of-bounds store:
212 buf[2]
213 Unable to resolve constraint:
214 requires maxSet(buf @ multiError.c:4) >= 2
215 needed to satisfy precondition:
216 requires maxSet(buf @ multiError.c:4) >= 2
217
218Finished checking --- 1 code warning, as expected
219
45569d72 220bounds.c:9: Possible out-of-bounds store:
f8f5727a 221 strcpy(str, tmp)
222 Unable to resolve constraint:
45569d72 223 requires maxSet(str @ bounds.c:9) >=
224 maxRead(getenv("MYENV") @ bounds.c:7)
f8f5727a 225 needed to satisfy precondition:
45569d72 226 requires maxSet(str @ bounds.c:9) >=
227 maxRead(tmp @ bounds.c:9)
f8f5727a 228 derived from strcpy precondition: requires
45569d72 229 maxSet(<parameter 1>) >= maxRead(<parameter
230 2>)
f8f5727a 231
232Finished checking --- 1 code warning, as expected
This page took 0.189739 seconds and 5 git commands to generate.