]> andersk Git - splint.git/blob - test/manual.expect
e975c0069d5a0c0efae21a8874666cf465665db8
[splint.git] / test / manual.expect
1
2 sample.c:11: Fresh storage x not released before
3                 return
4    sample.c:5: Fresh storage x created
5 sample.c:5: Variable x declared but not used
6
7 Finished checking --- 2 code warnings, as expected
8
9 null.c:3: Dereference of possibly null pointer s: *s
10    null.c:1: Storage s may become null
11
12 Finished checking --- 1 code warning, as expected
13
14 Finished checking --- no warnings
15
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)
21
22 Finished checking --- 3 code warnings, as expected
23
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)
27
28 Finished checking --- 2 code warnings, as expected
29
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
38
39 Finished checking --- 7 code warnings, as expected
40
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 *:
49     "bob"
50
51 Finished checking --- 4 code warnings, as
52 expected
53
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:
58               glob = y
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:
64               z
65 only.c:14: Fresh storage m not released before return
66    only.c:9: Fresh storage m created
67
68 Finished checking --- 6 code warnings, as expected
69
70 stack.c:12: Stack-allocated storage &loc reachable
71                from return value: &loc
72 stack.c:12: Stack-allocated storage *x reachable from
73                parameter x
74    stack.c:10: Storage *x becomes stack-allocated
75    storage
76 stack.c:12: Stack-allocated storage glob reachable
77                from global glob
78    stack.c:9: Storage glob becomes stack-allocated
79    storage
80
81 Finished checking --- 3 code warnings, as expected
82
83 rstring.c:13: Reference counted storage returned
84                  without modifying reference count: r1
85
86 Finished checking --- 1 code warning, as expected
87
88 unique.c:7: Parameter 1 (s) to function strcpy is
89     declared unique but may be aliased externally by
90     parameter 2 (t)
91
92 Finished checking --- 1 code warning, as expected
93
94 exposure.c:6: Function returns reference to
95                  parameter e: e->name
96 exposure.c:6: Return value exposes rep of
97                  employee: e->name
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
104
105 Finished checking --- 4 code warnings, as
106 expected
107
108 modify.c:4: Undocumented modification of *y: *y = *x
109 modify.c:5: Suspect object listed in modifies of setx
110                not modified: *x
111    modify.c:1: Declaration of setx
112
113 Finished checking --- 2 code warnings, as expected
114
115 globals.c:5: Undocumented use of global glob2
116 globals.c:3: Global glob1 listed but not used
117
118 Finished checking --- 2 code warnings, as expected
119
120 annotglobs.c:13: Undef global globnum used before
121                     definition
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
126     (memory leak)
127
128 Finished checking --- 3 code warnings, as expected
129
130 Finished checking --- no warnings
131
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):
138     modglob() * glob
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):
142     mystery() * glob
143
144 Finished checking --- 4 code warnings, as expected
145
146 order.c:11: Expression has undefined behavior (value
147     of right operand modified by left operand):
148     x++ * x
149 order.c:13: Expression has undefined behavior (left
150     operand uses i, modified by right operand):
151     y[i] = i++
152 order.c:14: Expression has undefined behavior (value
153     of right operand modified by left operand):
154     modglob() * glob
155
156 Finished checking --- 3 code warnings, as expected
157
158 loop.c:14: Suspected infinite loop.  No value used in
159     loop test (x, glob1) is modified by test or loop
160     body.
161 loop.c:15: Suspected infinite loop.  No condition
162     values modified.  Modification possible through
163     unconstrained calls: h
164
165 Finished checking --- 2 code warnings, as expected
166
167 loop.c:14: Suspected infinite loop.  No value used in
168     loop test (x, glob1) is modified by test or loop
169     body.
170
171 Finished checking --- 1 code warning, as expected
172
173 switch.c:11: Fall through case (no preceding break)
174 switch.c:14: Missing case in switch: DEFINITELY
175
176 Finished checking --- 2 code warnings, as expected
177
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):
183     mysterycall(x)
184
185 Finished checking --- 3 code warnings, as expected
186
187 noeffect.c:6: Statement has no effect: y == *x
188 noeffect.c:7: Statement has no effect: nomodcall(x)
189
190 Finished checking --- 2 code warnings, as expected
191
192 ignore.c:8: Return value (type int) ignored: fi()
193 ignore.c:10: Return value (type bool) ignored: fb()
194
195 Finished checking --- 2 code warnings, as expected
196
197 ignore.c:8: Return value (type int) ignored: fi()
198
199 Finished checking --- 1 code warning, as expected
200
201 ignore.c:10: Return value (type bool) ignored: fb()
202
203 Finished checking --- 1 code warning, as expected
204
205 setChar.c:5: Likely out-of-bounds store:
206     buf[10]
207     Unable to resolve constraint:
208     requires 9 >= 10
209      needed to satisfy precondition:
210     requires maxSet(buf @ setChar.c:5) >= 10
211
212 Finished checking --- 1 code warning, as expected
213
214 multiError.c:4: Possible out-of-bounds store:
215     buf[2]
216     Unable to resolve constraint:
217     requires maxSet(buf @ multiError.c:4) >= 2
218      needed to satisfy precondition:
219     requires maxSet(buf @ multiError.c:4) >= 2
220
221 Finished checking --- 1 code warning, as expected
222
223 bounds.c:9: Possible out-of-bounds store:
224     strcpy(str, tmp)
225     Unable to resolve constraint:
226     requires maxSet(str @ bounds.c:9) >=
227     maxRead(getenv("MYENV") @ bounds.c:7)
228      needed to satisfy precondition:
229     requires maxSet(str @ bounds.c:9) >=
230     maxRead(tmp @ bounds.c:9)
231      derived from strcpy precondition: requires
232     maxSet(<parameter 1>) >= maxRead(<parameter
233     2>)
234
235 Finished checking --- 1 code warning, as expected
This page took 0.71123 seconds and 3 git commands to generate.