Commit | Line | Data |
0453d815 |
1 | sv.c |
599cee73 |
2 | |
3 | warn(warn_uninit); |
4 | |
5 | warn(warn_uninit); |
6 | |
7 | warn(warn_uninit); |
8 | |
9 | warn(warn_uninit); |
10 | |
11 | not_a_number(sv); |
12 | |
13 | not_a_number(sv); |
14 | |
15 | warn(warn_uninit); |
16 | |
17 | not_a_number(sv); |
18 | |
19 | warn(warn_uninit); |
20 | |
21 | not_a_number(sv); |
22 | |
23 | not_a_number(sv); |
24 | |
25 | warn(warn_uninit); |
26 | |
27 | warn(warn_uninit); |
28 | |
29 | Subroutine %s redefined |
30 | |
31 | Invalid conversion in %s: |
32 | |
33 | Undefined value assigned to typeglob |
34 | |
6bc102ca |
35 | Possible Y2K bug: %d format string following '19' |
36 | |
767a6a26 |
37 | Reference is already weak [Perl_sv_rvweaken] <<TODO |
38 | |
0453d815 |
39 | Mandatory Warnings |
40 | ------------------ |
7e2040f0 |
41 | Malformed UTF-8 character [sv_pos_b2u] (not tested: difficult to produce |
42 | with perl now) |
0453d815 |
43 | |
44 | Mandatory Warnings TODO |
45 | ------------------ |
46 | Attempt to free non-arena SV: 0x%lx [del_sv] |
47 | Reference miscount in sv_replace() [sv_replace] |
48 | Attempt to free unreferenced scalar [sv_free] |
49 | Attempt to free temp prematurely: SV 0x%lx [sv_free] |
50 | semi-panic: attempt to dup freed string [newSVsv] |
51 | |
599cee73 |
52 | |
53 | __END__ |
54 | # sv.c |
55 | use integer ; |
4438c4b7 |
56 | use warnings 'uninitialized' ; |
599cee73 |
57 | $x = 1 + $a[0] ; # a |
4438c4b7 |
58 | no warnings 'uninitialized' ; |
0453d815 |
59 | $x = 1 + $b[0] ; # a |
599cee73 |
60 | EXPECT |
b89fed5f |
61 | Use of uninitialized value in integer addition (+) at - line 4. |
599cee73 |
62 | ######## |
63 | # sv.c (sv_2iv) |
64 | package fred ; |
65 | sub TIESCALAR { my $x ; bless \$x} |
66 | sub FETCH { return undef } |
67 | sub STORE { return 1 } |
68 | package main ; |
69 | tie $A, 'fred' ; |
70 | use integer ; |
4438c4b7 |
71 | use warnings 'uninitialized' ; |
599cee73 |
72 | $A *= 2 ; |
4438c4b7 |
73 | no warnings 'uninitialized' ; |
0453d815 |
74 | $A *= 2 ; |
599cee73 |
75 | EXPECT |
b89fed5f |
76 | Use of uninitialized value in integer multiplication (*) at - line 10. |
599cee73 |
77 | ######## |
78 | # sv.c |
79 | use integer ; |
4438c4b7 |
80 | use warnings 'uninitialized' ; |
599cee73 |
81 | my $x *= 2 ; #b |
4438c4b7 |
82 | no warnings 'uninitialized' ; |
0453d815 |
83 | my $y *= 2 ; #b |
599cee73 |
84 | EXPECT |
b89fed5f |
85 | Use of uninitialized value in integer multiplication (*) at - line 4. |
599cee73 |
86 | ######## |
87 | # sv.c (sv_2uv) |
88 | package fred ; |
89 | sub TIESCALAR { my $x ; bless \$x} |
90 | sub FETCH { return undef } |
91 | sub STORE { return 1 } |
92 | package main ; |
93 | tie $A, 'fred' ; |
4438c4b7 |
94 | use warnings 'uninitialized' ; |
599cee73 |
95 | $B = 0 ; |
96 | $B |= $A ; |
4438c4b7 |
97 | no warnings 'uninitialized' ; |
0453d815 |
98 | $B = 0 ; |
99 | $B |= $A ; |
599cee73 |
100 | EXPECT |
b89fed5f |
101 | Use of uninitialized value in bitwise or (|) at - line 10. |
599cee73 |
102 | ######## |
103 | # sv.c |
4438c4b7 |
104 | use warnings 'uninitialized' ; |
599cee73 |
105 | my $Y = 1 ; |
0453d815 |
106 | my $x = 1 | $a[$Y] ; |
4438c4b7 |
107 | no warnings 'uninitialized' ; |
0453d815 |
108 | my $Y = 1 ; |
109 | $x = 1 | $b[$Y] ; |
599cee73 |
110 | EXPECT |
b89fed5f |
111 | Use of uninitialized value in bitwise or (|) at - line 4. |
599cee73 |
112 | ######## |
113 | # sv.c |
4438c4b7 |
114 | use warnings 'uninitialized' ; |
599cee73 |
115 | my $x *= 1 ; # d |
4438c4b7 |
116 | no warnings 'uninitialized' ; |
0453d815 |
117 | my $y *= 1 ; # d |
599cee73 |
118 | EXPECT |
b89fed5f |
119 | Use of uninitialized value in multiplication (*) at - line 3. |
599cee73 |
120 | ######## |
121 | # sv.c |
4438c4b7 |
122 | use warnings 'uninitialized' ; |
599cee73 |
123 | $x = 1 + $a[0] ; # e |
4438c4b7 |
124 | no warnings 'uninitialized' ; |
0453d815 |
125 | $x = 1 + $b[0] ; # e |
599cee73 |
126 | EXPECT |
b89fed5f |
127 | Use of uninitialized value in addition (+) at - line 3. |
599cee73 |
128 | ######## |
129 | # sv.c (sv_2nv) |
130 | package fred ; |
131 | sub TIESCALAR { my $x ; bless \$x} |
132 | sub FETCH { return undef } |
133 | sub STORE { return 1 } |
134 | package main ; |
135 | tie $A, 'fred' ; |
4438c4b7 |
136 | use warnings 'uninitialized' ; |
599cee73 |
137 | $A *= 2 ; |
4438c4b7 |
138 | no warnings 'uninitialized' ; |
0453d815 |
139 | $A *= 2 ; |
599cee73 |
140 | EXPECT |
b89fed5f |
141 | Use of uninitialized value in multiplication (*) at - line 9. |
599cee73 |
142 | ######## |
143 | # sv.c |
4438c4b7 |
144 | use warnings 'uninitialized' ; |
599cee73 |
145 | $x = $y + 1 ; # f |
4438c4b7 |
146 | no warnings 'uninitialized' ; |
0453d815 |
147 | $x = $z + 1 ; # f |
599cee73 |
148 | EXPECT |
b89fed5f |
149 | Use of uninitialized value in addition (+) at - line 3. |
599cee73 |
150 | ######## |
151 | # sv.c |
4438c4b7 |
152 | use warnings 'uninitialized' ; |
599cee73 |
153 | $x = chop undef ; # g |
4438c4b7 |
154 | no warnings 'uninitialized' ; |
0453d815 |
155 | $x = chop undef ; # g |
599cee73 |
156 | EXPECT |
b0c98cec |
157 | Modification of a read-only value attempted at - line 3. |
599cee73 |
158 | ######## |
159 | # sv.c |
4438c4b7 |
160 | use warnings 'uninitialized' ; |
599cee73 |
161 | $x = chop $y ; # h |
4438c4b7 |
162 | no warnings 'uninitialized' ; |
0453d815 |
163 | $x = chop $z ; # h |
599cee73 |
164 | EXPECT |
b89fed5f |
165 | Use of uninitialized value in scalar chop at - line 3. |
599cee73 |
166 | ######## |
167 | # sv.c (sv_2pv) |
168 | package fred ; |
169 | sub TIESCALAR { my $x ; bless \$x} |
170 | sub FETCH { return undef } |
171 | sub STORE { return 1 } |
172 | package main ; |
173 | tie $A, 'fred' ; |
4438c4b7 |
174 | use warnings 'uninitialized' ; |
599cee73 |
175 | $B = "" ; |
176 | $B .= $A ; |
4438c4b7 |
177 | no warnings 'uninitialized' ; |
0453d815 |
178 | $C = "" ; |
179 | $C .= $A ; |
599cee73 |
180 | EXPECT |
297b36dc |
181 | Use of uninitialized value in concatenation (.) or string at - line 10. |
599cee73 |
182 | ######## |
183 | # sv.c |
4438c4b7 |
184 | use warnings 'numeric' ; |
599cee73 |
185 | sub TIESCALAR{bless[]} ; |
186 | sub FETCH {"def"} ; |
187 | tie $a,"main" ; |
0453d815 |
188 | my $b = 1 + $a; |
4438c4b7 |
189 | no warnings 'numeric' ; |
0453d815 |
190 | my $c = 1 + $a; |
599cee73 |
191 | EXPECT |
42d38218 |
192 | Argument "def" isn't numeric in addition (+) at - line 6. |
599cee73 |
193 | ######## |
194 | # sv.c |
4438c4b7 |
195 | use warnings 'numeric' ; |
599cee73 |
196 | my $x = 1 + "def" ; |
4438c4b7 |
197 | no warnings 'numeric' ; |
0453d815 |
198 | my $z = 1 + "def" ; |
599cee73 |
199 | EXPECT |
42d38218 |
200 | Argument "def" isn't numeric in addition (+) at - line 3. |
599cee73 |
201 | ######## |
202 | # sv.c |
4438c4b7 |
203 | use warnings 'numeric' ; |
599cee73 |
204 | my $a = "def" ; |
205 | my $x = 1 + $a ; |
4438c4b7 |
206 | no warnings 'numeric' ; |
0453d815 |
207 | my $y = 1 + $a ; |
599cee73 |
208 | EXPECT |
42d38218 |
209 | Argument "def" isn't numeric in addition (+) at - line 4. |
599cee73 |
210 | ######## |
211 | # sv.c |
4438c4b7 |
212 | use warnings 'numeric' ; use integer ; |
599cee73 |
213 | my $a = "def" ; |
214 | my $x = 1 + $a ; |
4438c4b7 |
215 | no warnings 'numeric' ; |
0453d815 |
216 | my $z = 1 + $a ; |
599cee73 |
217 | EXPECT |
42d38218 |
218 | Argument "def" isn't numeric in integer addition (+) at - line 4. |
599cee73 |
219 | ######## |
220 | # sv.c |
4438c4b7 |
221 | use warnings 'numeric' ; |
599cee73 |
222 | my $x = 1 & "def" ; |
4438c4b7 |
223 | no warnings 'numeric' ; |
0453d815 |
224 | my $z = 1 & "def" ; |
599cee73 |
225 | EXPECT |
42d38218 |
226 | Argument "def" isn't numeric in bitwise and (&) at - line 3. |
599cee73 |
227 | ######## |
228 | # sv.c |
59bb5845 |
229 | use warnings 'numeric' ; |
230 | my $x = pack i => "def" ; |
231 | no warnings 'numeric' ; |
232 | my $z = pack i => "def" ; |
233 | EXPECT |
234 | Argument "def" isn't numeric in pack at - line 3. |
235 | ######## |
236 | # sv.c |
237 | use warnings 'numeric' ; |
238 | my $a = "d\0f" ; |
239 | my $x = 1 + $a ; |
240 | no warnings 'numeric' ; |
241 | my $z = 1 + $a ; |
242 | EXPECT |
243 | Argument "d\0f" isn't numeric in addition (+) at - line 4. |
244 | ######## |
245 | # sv.c |
4438c4b7 |
246 | use warnings 'redefine' ; |
599cee73 |
247 | sub fred {} |
248 | sub joe {} |
249 | *fred = \&joe ; |
4438c4b7 |
250 | no warnings 'redefine' ; |
0453d815 |
251 | sub jim {} |
252 | *jim = \&joe ; |
599cee73 |
253 | EXPECT |
254 | Subroutine fred redefined at - line 5. |
255 | ######## |
256 | # sv.c |
4438c4b7 |
257 | use warnings 'printf' ; |
3eeba6fb |
258 | open F, ">".($^O eq 'VMS'? 'NL:' : '/dev/null') ; |
cf2093f6 |
259 | printf F "%z\n" ; |
260 | my $a = sprintf "%z" ; |
599cee73 |
261 | printf F "%" ; |
262 | $a = sprintf "%" ; |
263 | printf F "%\x02" ; |
264 | $a = sprintf "%\x02" ; |
4438c4b7 |
265 | no warnings 'printf' ; |
cf2093f6 |
266 | printf F "%z\n" ; |
267 | $a = sprintf "%z" ; |
0453d815 |
268 | printf F "%" ; |
269 | $a = sprintf "%" ; |
270 | printf F "%\x02" ; |
271 | $a = sprintf "%\x02" ; |
599cee73 |
272 | EXPECT |
cf2093f6 |
273 | Invalid conversion in sprintf: "%z" at - line 5. |
599cee73 |
274 | Invalid conversion in sprintf: end of string at - line 7. |
275 | Invalid conversion in sprintf: "%\002" at - line 9. |
cf2093f6 |
276 | Invalid conversion in printf: "%z" at - line 4. |
599cee73 |
277 | Invalid conversion in printf: end of string at - line 6. |
278 | Invalid conversion in printf: "%\002" at - line 8. |
279 | ######## |
280 | # sv.c |
e476b1b5 |
281 | use warnings 'misc' ; |
599cee73 |
282 | *a = undef ; |
e476b1b5 |
283 | no warnings 'misc' ; |
0453d815 |
284 | *b = undef ; |
599cee73 |
285 | EXPECT |
286 | Undefined value assigned to typeglob at - line 3. |
0453d815 |
287 | ######## |
288 | # sv.c |
e476b1b5 |
289 | use warnings 'y2k'; |
6bc102ca |
290 | use Config; |
291 | BEGIN { |
292 | unless ($Config{ccflags} =~ /Y2KWARN/) { |
293 | print "SKIPPED\n# perl not built with -DPERL_Y2KWARN"; |
294 | exit 0; |
295 | } |
296 | $|=1; |
297 | } |
298 | my $x; |
299 | my $yy = 78; |
300 | $x = printf "19%02d\n", $yy; |
301 | $x = sprintf "#19%02d\n", $yy; |
302 | $x = printf " 19%02d\n", 78; |
303 | $x = sprintf "19%02d\n", 78; |
304 | $x = printf "319%02d\n", $yy; |
305 | $x = sprintf "319%02d\n", $yy; |
e476b1b5 |
306 | no warnings 'y2k'; |
6bc102ca |
307 | $x = printf "19%02d\n", $yy; |
308 | $x = sprintf "19%02d\n", $yy; |
309 | $x = printf "19%02d\n", 78; |
310 | $x = sprintf "19%02d\n", 78; |
311 | EXPECT |
312 | Possible Y2K bug: %d format string following '19' at - line 16. |
313 | Possible Y2K bug: %d format string following '19' at - line 13. |
314 | 1978 |
315 | Possible Y2K bug: %d format string following '19' at - line 14. |
316 | Possible Y2K bug: %d format string following '19' at - line 15. |
317 | 1978 |
318 | 31978 |
319 | 1978 |
320 | 1978 |