]> andersk Git - splint.git/blame - test/manual.expect
Made allocations involving sizeof work correctly (test/malloc.c).
[splint.git] / test / manual.expect
CommitLineData
27c9e640 1
2sample.c:11: Fresh storage x not released before
3 return
16c024b5 4 sample.c:5: Fresh storage x created
27c9e640 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
16c024b5 66 only.c:9: Fresh storage m created
27c9e640 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
16c024b5 74 stack.c:10: Storage *x becomes stack-allocated
75 storage
27c9e640 76stack.c:12: Stack-allocated storage glob reachable
77 from global glob
16c024b5 78 stack.c:9: Storage glob becomes stack-allocated
79 storage
27c9e640 80
81Finished checking --- 3 code warnings, as expected
82
83rstring.c:13: Reference counted storage returned
84 without modifying reference count: r1
85
86Finished checking --- 1 code warning, as expected
87
88unique.c:7: Parameter 1 (s) to function strcpy is
89 declared unique but may be aliased externally by
90 parameter 2 (t)
91
92Finished checking --- 1 code warning, as expected
93
94exposure.c:6: Function returns reference to
95 parameter e: e->name
96exposure.c:6: Return value exposes rep of
97 employee: e->name
98exposure.c:6: Released storage e->name reachable
99 from parameter at return point
16c024b5 100 exposure.c:6: Storage e->name released
27c9e640 101exposure.c:23: Suspect modification of observer
102 name: *name = toupper(*name)
16c024b5 103 exposure.c:22: Storage *name becomes observer
27c9e640 104
105Finished checking --- 4 code warnings, as
106expected
107
108modify.c:4: Undocumented modification of *y: *y = *x
109modify.c:5: Suspect object listed in modifies of setx
110 not modified: *x
111 modify.c:1: Declaration of setx
112
113Finished checking --- 2 code warnings, as expected
114
115globals.c:5: Undocumented use of global glob2
116globals.c:3: Global glob1 listed but not used
117
118Finished checking --- 2 code warnings, as expected
119
120annotglobs.c:13: Undef global globnum used before
121 definition
122annotglobs.c:15: Global storage globname contains 1
123 undefined field when call returns: firstname
124annotglobs.c:21: Only storage globname.firstname (type
125 char *) derived from killed global is not released
126 (memory leak)
127
128Finished checking --- 3 code warnings, as expected
129
130Finished checking --- no warnings
131
132order.c:11: Expression has undefined behavior (value of
133 right operand modified by left operand): x++ * x
134order.c:13: Expression has undefined behavior (left operand
135 uses i, modified by right operand): y[i] = i++
136order.c:14: Expression has undefined behavior (value of
137 right operand modified by left operand):
138 modglob() * glob
139order.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
144Finished checking --- 4 code warnings, as expected
145
146order.c:11: Expression has undefined behavior (value
147 of right operand modified by left operand):
148 x++ * x
149order.c:13: Expression has undefined behavior (left
150 operand uses i, modified by right operand):
151 y[i] = i++
152order.c:14: Expression has undefined behavior (value
153 of right operand modified by left operand):
154 modglob() * glob
155
156Finished checking --- 3 code warnings, as expected
157
158loop.c:14: Suspected infinite loop. No value used in
159 loop test (x, glob1) is modified by test or loop
160 body.
161loop.c:15: Suspected infinite loop. No condition
162 values modified. Modification possible through
163 unconstrained calls: h
164
165Finished checking --- 2 code warnings, as expected
166
167loop.c:14: Suspected infinite loop. No value used in
168 loop test (x, glob1) is modified by test or loop
169 body.
170
171Finished checking --- 1 code warning, as expected
172
173switch.c:11: Fall through case (no preceding break)
174switch.c:14: Missing case in switch: DEFINITELY
175
176Finished checking --- 2 code warnings, as expected
177
178noeffect.c:6: Statement has no effect: y == *x
179noeffect.c:7: Statement has no effect: nomodcall(x)
180noeffect.c:8: Statement has no effect (possible
181 undected modification through call to
182 unconstrained function mysterycall):
183 mysterycall(x)
184
185Finished checking --- 3 code warnings, as expected
186
187noeffect.c:6: Statement has no effect: y == *x
188noeffect.c:7: Statement has no effect: nomodcall(x)
189
190Finished checking --- 2 code warnings, as expected
191
192ignore.c:8: Return value (type int) ignored: fi()
193ignore.c:10: Return value (type bool) ignored: fb()
194
195Finished checking --- 2 code warnings, as expected
196
197ignore.c:8: Return value (type int) ignored: fi()
198
199Finished checking --- 1 code warning, as expected
200
201ignore.c:10: Return value (type bool) ignored: fb()
202
203Finished checking --- 1 code warning, as expected
f8f5727a 204
6317f163 205setChar.c:5: Likely out-of-bounds store: buf[10]
f8f5727a 206 Unable to resolve constraint:
207 requires 9 >= 10
208 needed to satisfy precondition:
209 requires maxSet(buf @ setChar.c:5) >= 10
210
211Finished checking --- 1 code warning, as expected
212
6317f163 213multiError.c:4: Possible out-of-bounds store: buf[2]
f8f5727a 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
218
219Finished checking --- 1 code warning, as expected
220
45569d72 221bounds.c:9: Possible out-of-bounds store:
f8f5727a 222 strcpy(str, tmp)
223 Unable to resolve constraint:
45569d72 224 requires maxSet(str @ bounds.c:9) >=
225 maxRead(getenv("MYENV") @ bounds.c:7)
f8f5727a 226 needed to satisfy precondition:
45569d72 227 requires maxSet(str @ bounds.c:9) >=
228 maxRead(tmp @ bounds.c:9)
f8f5727a 229 derived from strcpy precondition: requires
45569d72 230 maxSet(<parameter 1>) >= maxRead(<parameter
231 2>)
f8f5727a 232
233Finished checking --- 1 code warning, as expected
This page took 0.089792 seconds and 5 git commands to generate.