Commit | Line | Data |
599cee73 |
1 | toke.c AOK |
2 | |
3 | we seem to have lost a few ambiguous warnings!! |
4 | |
5 | |
599cee73 |
6 | $a = <<; |
7 | Use of comma-less variable list is deprecated |
8 | (called 3 times via depcom) |
9 | |
10 | \1 better written as $1 |
4438c4b7 |
11 | use warnings 'syntax' ; |
599cee73 |
12 | s/(abc)/\1/; |
13 | |
14 | warn(warn_nosemi) |
15 | Semicolon seems to be missing |
16 | $a = 1 |
17 | &time ; |
18 | |
19 | |
20 | Reversed %c= operator |
21 | my $a =+ 2 ; |
22 | $a =- 2 ; |
23 | $a =* 2 ; |
24 | $a =% 2 ; |
25 | $a =& 2 ; |
26 | $a =. 2 ; |
27 | $a =^ 2 ; |
28 | $a =| 2 ; |
29 | $a =< 2 ; |
30 | $a =/ 2 ; |
31 | |
32 | Multidimensional syntax %.*s not supported |
33 | my $a = $a[1,2] ; |
34 | |
35 | You need to quote \"%s\"" |
36 | sub fred {} ; $SIG{TERM} = fred; |
37 | |
38 | Scalar value %.*s better written as $%.*s" |
39 | @a[3] = 2; |
40 | @a{3} = 2; |
41 | |
42 | Can't use \\%c to mean $%c in expression |
43 | $_ = "ab" ; s/(ab)/\1/e; |
44 | |
45 | Unquoted string "abc" may clash with future reserved word at - line 3. |
46 | warn(warn_reserved |
47 | $a = abc; |
48 | |
599cee73 |
49 | Possible attempt to separate words with commas |
50 | @a = qw(a, b, c) ; |
51 | |
52 | Possible attempt to put comments in qw() list |
53 | @a = qw(a b # c) ; |
54 | |
599cee73 |
55 | %s (...) interpreted as function |
56 | print ("") |
57 | printf ("") |
58 | sort ("") |
59 | |
60 | Ambiguous use of %c{%s%s} resolved to %c%s%s |
61 | $a = ${time[2]} |
62 | $a = ${time{2}} |
63 | |
64 | |
65 | Ambiguous use of %c{%s} resolved to %c%s |
66 | $a = ${time} |
67 | sub fred {} $a = ${fred} |
68 | |
69 | Misplaced _ in number |
70 | $a = 1_2; |
71 | $a = 1_2345_6; |
72 | |
73 | Bareword \"%s\" refers to nonexistent package |
74 | $a = FRED:: ; |
75 | |
76 | Ambiguous call resolved as CORE::%s(), qualify as such or use & |
77 | sub time {} |
78 | my $a = time() |
79 | |
767a6a26 |
80 | Unrecognized escape \\%c passed through |
81 | $a = "\m" ; |
82 | |
83 | %s number > %s non-portable |
84 | my $a = 0b011111111111111111111111111111110 ; |
85 | $a = 0b011111111111111111111111111111111 ; |
86 | $a = 0b111111111111111111111111111111111 ; |
87 | $a = 0x0fffffffe ; |
88 | $a = 0x0ffffffff ; |
89 | $a = 0x1ffffffff ; |
90 | $a = 0037777777776 ; |
91 | $a = 0037777777777 ; |
92 | $a = 0047777777777 ; |
93 | |
94 | Integer overflow in binary number |
95 | my $a = 0b011111111111111111111111111111110 ; |
96 | $a = 0b011111111111111111111111111111111 ; |
97 | $a = 0b111111111111111111111111111111111 ; |
98 | $a = 0x0fffffffe ; |
99 | $a = 0x0ffffffff ; |
100 | $a = 0x1ffffffff ; |
101 | $a = 0037777777776 ; |
102 | $a = 0037777777777 ; |
103 | $a = 0047777777777 ; |
ac206dc8 |
104 | |
105 | dump() better written as CORE::dump() |
4ac733c9 |
106 | |
107 | Use of /c modifier is meaningless without /g |
108 | |
0453d815 |
109 | Mandatory Warnings |
110 | ------------------ |
111 | Use of "%s" without parentheses is ambiguous [check_uni] |
112 | rand + 4 |
113 | |
114 | Ambiguous use of -%s resolved as -&%s() [yylex] |
115 | sub fred {} ; - fred ; |
116 | |
117 | Precedence problem: open %.*s should be open(%.*s) [yylex] |
118 | open FOO || die; |
119 | |
120 | Operator or semicolon missing before %c%s [yylex] |
121 | Ambiguous use of %c resolved as operator %c |
122 | *foo *foo |
123 | |
599cee73 |
124 | __END__ |
125 | # toke.c |
a4f5cc89 |
126 | use warnings 'deprecated' ; |
599cee73 |
127 | format STDOUT = |
128 | @<<< @||| @>>> @>>> |
129 | $a $b "abc" 'def' |
130 | . |
4438c4b7 |
131 | no warnings 'deprecated' ; |
0453d815 |
132 | format STDOUT = |
133 | @<<< @||| @>>> @>>> |
134 | $a $b "abc" 'def' |
135 | . |
599cee73 |
136 | EXPECT |
137 | Use of comma-less variable list is deprecated at - line 5. |
138 | Use of comma-less variable list is deprecated at - line 5. |
139 | Use of comma-less variable list is deprecated at - line 5. |
599cee73 |
140 | ######## |
141 | # toke.c |
4438c4b7 |
142 | use warnings 'deprecated' ; |
599cee73 |
143 | $a = <<; |
144 | |
4438c4b7 |
145 | no warnings 'deprecated' ; |
0453d815 |
146 | $a = <<; |
147 | |
599cee73 |
148 | EXPECT |
149 | Use of bare << to mean <<"" is deprecated at - line 3. |
150 | ######## |
151 | # toke.c |
4438c4b7 |
152 | use warnings 'syntax' ; |
599cee73 |
153 | s/(abc)/\1/; |
4438c4b7 |
154 | no warnings 'syntax' ; |
0453d815 |
155 | s/(abc)/\1/; |
599cee73 |
156 | EXPECT |
157 | \1 better written as $1 at - line 3. |
158 | ######## |
159 | # toke.c |
4438c4b7 |
160 | use warnings 'semicolon' ; |
599cee73 |
161 | $a = 1 |
162 | &time ; |
4438c4b7 |
163 | no warnings 'semicolon' ; |
0453d815 |
164 | $a = 1 |
165 | &time ; |
599cee73 |
166 | EXPECT |
167 | Semicolon seems to be missing at - line 3. |
168 | ######## |
169 | # toke.c |
4438c4b7 |
170 | use warnings 'syntax' ; |
599cee73 |
171 | my $a =+ 2 ; |
172 | $a =- 2 ; |
173 | $a =* 2 ; |
174 | $a =% 2 ; |
175 | $a =& 2 ; |
176 | $a =. 2 ; |
177 | $a =^ 2 ; |
178 | $a =| 2 ; |
179 | $a =< 2 ; |
180 | $a =/ 2 ; |
181 | EXPECT |
7f01dc7a |
182 | Reversed += operator at - line 3. |
183 | Reversed -= operator at - line 4. |
184 | Reversed *= operator at - line 5. |
185 | Reversed %= operator at - line 6. |
186 | Reversed &= operator at - line 7. |
187 | Reversed .= operator at - line 8. |
188 | Reversed ^= operator at - line 9. |
189 | Reversed |= operator at - line 10. |
190 | Reversed <= operator at - line 11. |
191 | syntax error at - line 8, near "=." |
192 | syntax error at - line 9, near "=^" |
193 | syntax error at - line 10, near "=|" |
194 | Unterminated <> operator at - line 11. |
599cee73 |
195 | ######## |
196 | # toke.c |
4438c4b7 |
197 | no warnings 'syntax' ; |
0453d815 |
198 | my $a =+ 2 ; |
199 | $a =- 2 ; |
200 | $a =* 2 ; |
201 | $a =% 2 ; |
202 | $a =& 2 ; |
203 | $a =. 2 ; |
204 | $a =^ 2 ; |
205 | $a =| 2 ; |
206 | $a =< 2 ; |
207 | $a =/ 2 ; |
208 | EXPECT |
7f01dc7a |
209 | syntax error at - line 8, near "=." |
210 | syntax error at - line 9, near "=^" |
211 | syntax error at - line 10, near "=|" |
212 | Unterminated <> operator at - line 11. |
0453d815 |
213 | ######## |
214 | # toke.c |
4438c4b7 |
215 | use warnings 'syntax' ; |
599cee73 |
216 | my $a = $a[1,2] ; |
4438c4b7 |
217 | no warnings 'syntax' ; |
0453d815 |
218 | my $a = $a[1,2] ; |
599cee73 |
219 | EXPECT |
220 | Multidimensional syntax $a[1,2] not supported at - line 3. |
221 | ######## |
222 | # toke.c |
4438c4b7 |
223 | use warnings 'syntax' ; |
599cee73 |
224 | sub fred {} ; $SIG{TERM} = fred; |
4438c4b7 |
225 | no warnings 'syntax' ; |
0453d815 |
226 | $SIG{TERM} = fred; |
599cee73 |
227 | EXPECT |
228 | You need to quote "fred" at - line 3. |
229 | ######## |
230 | # toke.c |
4438c4b7 |
231 | use warnings 'syntax' ; |
599cee73 |
232 | @a[3] = 2; |
233 | @a{3} = 2; |
4438c4b7 |
234 | no warnings 'syntax' ; |
0453d815 |
235 | @a[3] = 2; |
236 | @a{3} = 2; |
599cee73 |
237 | EXPECT |
238 | Scalar value @a[3] better written as $a[3] at - line 3. |
239 | Scalar value @a{3} better written as $a{3} at - line 4. |
240 | ######## |
241 | # toke.c |
4438c4b7 |
242 | use warnings 'syntax' ; |
599cee73 |
243 | $_ = "ab" ; |
244 | s/(ab)/\1/e; |
4438c4b7 |
245 | no warnings 'syntax' ; |
0453d815 |
246 | $_ = "ab" ; |
247 | s/(ab)/\1/e; |
599cee73 |
248 | EXPECT |
249 | Can't use \1 to mean $1 in expression at - line 4. |
250 | ######## |
251 | # toke.c |
4438c4b7 |
252 | use warnings 'reserved' ; |
599cee73 |
253 | $a = abc; |
1c3923b3 |
254 | $a = { def |
255 | |
256 | => 1 }; |
4438c4b7 |
257 | no warnings 'reserved' ; |
0453d815 |
258 | $a = abc; |
599cee73 |
259 | EXPECT |
260 | Unquoted string "abc" may clash with future reserved word at - line 3. |
261 | ######## |
262 | # toke.c |
e476b1b5 |
263 | use warnings 'qw' ; |
599cee73 |
264 | @a = qw(a, b, c) ; |
e476b1b5 |
265 | no warnings 'qw' ; |
0453d815 |
266 | @a = qw(a, b, c) ; |
599cee73 |
267 | EXPECT |
268 | Possible attempt to separate words with commas at - line 3. |
269 | ######## |
270 | # toke.c |
e476b1b5 |
271 | use warnings 'qw' ; |
599cee73 |
272 | @a = qw(a b #) ; |
e476b1b5 |
273 | no warnings 'qw' ; |
0453d815 |
274 | @a = qw(a b #) ; |
599cee73 |
275 | EXPECT |
276 | Possible attempt to put comments in qw() list at - line 3. |
277 | ######## |
278 | # toke.c |
4438c4b7 |
279 | use warnings 'syntax' ; |
599cee73 |
280 | print ("") |
281 | EXPECT |
282 | print (...) interpreted as function at - line 3. |
283 | ######## |
284 | # toke.c |
4438c4b7 |
285 | no warnings 'syntax' ; |
0453d815 |
286 | print ("") |
287 | EXPECT |
288 | |
289 | ######## |
290 | # toke.c |
4438c4b7 |
291 | use warnings 'syntax' ; |
599cee73 |
292 | printf ("") |
293 | EXPECT |
294 | printf (...) interpreted as function at - line 3. |
295 | ######## |
296 | # toke.c |
4438c4b7 |
297 | no warnings 'syntax' ; |
0453d815 |
298 | printf ("") |
299 | EXPECT |
300 | |
301 | ######## |
302 | # toke.c |
4438c4b7 |
303 | use warnings 'syntax' ; |
599cee73 |
304 | sort ("") |
305 | EXPECT |
306 | sort (...) interpreted as function at - line 3. |
307 | ######## |
308 | # toke.c |
4438c4b7 |
309 | no warnings 'syntax' ; |
0453d815 |
310 | sort ("") |
311 | EXPECT |
312 | |
313 | ######## |
314 | # toke.c |
4438c4b7 |
315 | use warnings 'ambiguous' ; |
599cee73 |
316 | $a = ${time[2]}; |
4438c4b7 |
317 | no warnings 'ambiguous' ; |
0453d815 |
318 | $a = ${time[2]}; |
599cee73 |
319 | EXPECT |
320 | Ambiguous use of ${time[...]} resolved to $time[...] at - line 3. |
321 | ######## |
322 | # toke.c |
4438c4b7 |
323 | use warnings 'ambiguous' ; |
599cee73 |
324 | $a = ${time{2}}; |
325 | EXPECT |
326 | Ambiguous use of ${time{...}} resolved to $time{...} at - line 3. |
327 | ######## |
328 | # toke.c |
4438c4b7 |
329 | no warnings 'ambiguous' ; |
0453d815 |
330 | $a = ${time{2}}; |
331 | EXPECT |
332 | |
333 | ######## |
334 | # toke.c |
4438c4b7 |
335 | use warnings 'ambiguous' ; |
599cee73 |
336 | $a = ${time} ; |
4438c4b7 |
337 | no warnings 'ambiguous' ; |
0453d815 |
338 | $a = ${time} ; |
599cee73 |
339 | EXPECT |
340 | Ambiguous use of ${time} resolved to $time at - line 3. |
341 | ######## |
342 | # toke.c |
4438c4b7 |
343 | use warnings 'ambiguous' ; |
599cee73 |
344 | sub fred {} |
345 | $a = ${fred} ; |
4438c4b7 |
346 | no warnings 'ambiguous' ; |
0453d815 |
347 | $a = ${fred} ; |
599cee73 |
348 | EXPECT |
349 | Ambiguous use of ${fred} resolved to $fred at - line 4. |
350 | ######## |
351 | # toke.c |
4438c4b7 |
352 | use warnings 'syntax' ; |
7fd134d9 |
353 | $a = _123; print "$a\n"; #( 3 string) |
354 | $a = 1_23; print "$a\n"; |
355 | $a = 12_3; print "$a\n"; |
356 | $a = 123_; print "$a\n"; # 6 |
357 | $a = _+123; print "$a\n"; # 7 string) |
358 | $a = +_123; print "$a\n"; #( 8 string) |
359 | $a = +1_23; print "$a\n"; |
360 | $a = +12_3; print "$a\n"; |
361 | $a = +123_; print "$a\n"; # 11 |
362 | $a = _-123; print "$a\n"; #(12 string) |
363 | $a = -_123; print "$a\n"; #(13 string) |
364 | $a = -1_23; print "$a\n"; |
365 | $a = -12_3; print "$a\n"; |
366 | $a = -123_; print "$a\n"; # 16 |
367 | $a = 123._456; print "$a\n"; # 17 |
368 | $a = 123.4_56; print "$a\n"; |
369 | $a = 123.45_6; print "$a\n"; |
370 | $a = 123.456_; print "$a\n"; # 20 |
371 | $a = +123._456; print "$a\n"; # 21 |
372 | $a = +123.4_56; print "$a\n"; |
373 | $a = +123.45_6; print "$a\n"; |
374 | $a = +123.456_; print "$a\n"; # 24 |
375 | $a = -123._456; print "$a\n"; # 25 |
376 | $a = -123.4_56; print "$a\n"; |
377 | $a = -123.45_6; print "$a\n"; |
378 | $a = -123.456_; print "$a\n"; # 28 |
379 | $a = 123.456E_12; print "$a\n"; # 29 |
380 | $a = 123.456E1_2; print "$a\n"; |
381 | $a = 123.456E12_; print "$a\n"; # 31 |
382 | $a = 123.456E_+12; print "$a\n"; # 32 |
383 | $a = 123.456E+_12; print "$a\n"; # 33 |
384 | $a = 123.456E+1_2; print "$a\n"; |
385 | $a = 123.456E+12_; print "$a\n"; # 35 |
386 | $a = 123.456E_-12; print "$a\n"; # 36 |
387 | $a = 123.456E-_12; print "$a\n"; # 37 |
388 | $a = 123.456E-1_2; print "$a\n"; |
389 | $a = 123.456E-12_; print "$a\n"; # 39 |
b3b48e3e |
390 | $a = 1__23; print "$a\n"; # 40 |
391 | $a = 12.3__4; print "$a\n"; # 41 |
392 | $a = 12.34e1__2; print "$a\n"; # 42 |
4438c4b7 |
393 | no warnings 'syntax' ; |
7fd134d9 |
394 | $a = _123; print "$a\n"; |
395 | $a = 1_23; print "$a\n"; |
396 | $a = 12_3; print "$a\n"; |
397 | $a = 123_; print "$a\n"; |
398 | $a = _+123; print "$a\n"; |
399 | $a = +_123; print "$a\n"; |
400 | $a = +1_23; print "$a\n"; |
401 | $a = +12_3; print "$a\n"; |
402 | $a = +123_; print "$a\n"; |
403 | $a = _-123; print "$a\n"; |
404 | $a = -_123; print "$a\n"; |
405 | $a = -1_23; print "$a\n"; |
406 | $a = -12_3; print "$a\n"; |
407 | $a = -123_; print "$a\n"; |
408 | $a = 123._456; print "$a\n"; |
409 | $a = 123.4_56; print "$a\n"; |
410 | $a = 123.45_6; print "$a\n"; |
411 | $a = 123.456_; print "$a\n"; |
412 | $a = +123._456; print "$a\n"; |
413 | $a = +123.4_56; print "$a\n"; |
414 | $a = +123.45_6; print "$a\n"; |
415 | $a = +123.456_; print "$a\n"; |
416 | $a = -123._456; print "$a\n"; |
417 | $a = -123.4_56; print "$a\n"; |
418 | $a = -123.45_6; print "$a\n"; |
419 | $a = -123.456_; print "$a\n"; |
420 | $a = 123.456E_12; print "$a\n"; |
421 | $a = 123.456E1_2; print "$a\n"; |
422 | $a = 123.456E12_; print "$a\n"; |
423 | $a = 123.456E_+12; print "$a\n"; |
424 | $a = 123.456E+_12; print "$a\n"; |
425 | $a = 123.456E+1_2; print "$a\n"; |
426 | $a = 123.456E+12_; print "$a\n"; |
427 | $a = 123.456E_-12; print "$a\n"; |
428 | $a = 123.456E-_12; print "$a\n"; |
429 | $a = 123.456E-1_2; print "$a\n"; |
430 | $a = 123.456E-12_; print "$a\n"; |
b3b48e3e |
431 | $a = 1__23; print "$a\n"; |
432 | $a = 12.3__4; print "$a\n"; |
433 | $a = 12.34e1__2; print "$a\n"; |
599cee73 |
434 | EXPECT |
fbfa96bd |
435 | OPTIONS regex |
928753ea |
436 | Misplaced _ in number at - line 6. |
928753ea |
437 | Misplaced _ in number at - line 11. |
7fd134d9 |
438 | Misplaced _ in number at - line 16. |
928753ea |
439 | Misplaced _ in number at - line 17. |
7fd134d9 |
440 | Misplaced _ in number at - line 20. |
928753ea |
441 | Misplaced _ in number at - line 21. |
7fd134d9 |
442 | Misplaced _ in number at - line 24. |
443 | Misplaced _ in number at - line 25. |
444 | Misplaced _ in number at - line 28. |
445 | Misplaced _ in number at - line 29. |
446 | Misplaced _ in number at - line 31. |
447 | Misplaced _ in number at - line 32. |
448 | Misplaced _ in number at - line 33. |
449 | Misplaced _ in number at - line 35. |
450 | Misplaced _ in number at - line 36. |
451 | Misplaced _ in number at - line 37. |
452 | Misplaced _ in number at - line 39. |
b3b48e3e |
453 | Misplaced _ in number at - line 40. |
454 | Misplaced _ in number at - line 41. |
455 | Misplaced _ in number at - line 42. |
928753ea |
456 | _123 |
457 | 123 |
928753ea |
458 | 123 |
7fd134d9 |
459 | 123 |
460 | 123 |
461 | _123 |
462 | 123 |
463 | 123 |
464 | 123 |
465 | -123 |
466 | -_123 |
467 | -123 |
468 | -123 |
469 | -123 |
470 | 123.456 |
471 | 123.456 |
472 | 123.456 |
473 | 123.456 |
474 | 123.456 |
475 | 123.456 |
476 | 123.456 |
477 | 123.456 |
478 | -123.456 |
479 | -123.456 |
480 | -123.456 |
481 | -123.456 |
482 | 123456000000000 |
483 | 123456000000000 |
484 | 123456000000000 |
485 | 123456000000000 |
486 | 123456000000000 |
487 | 123456000000000 |
488 | 123456000000000 |
fbfa96bd |
489 | 1.23456e-0?10 |
490 | 1.23456e-0?10 |
491 | 1.23456e-0?10 |
492 | 1.23456e-0?10 |
b3b48e3e |
493 | 123 |
494 | 12.34 |
495 | 12340000000000 |
7fd134d9 |
496 | _123 |
497 | 123 |
498 | 123 |
499 | 123 |
500 | 123 |
501 | _123 |
502 | 123 |
503 | 123 |
504 | 123 |
505 | -123 |
506 | -_123 |
507 | -123 |
508 | -123 |
509 | -123 |
510 | 123.456 |
511 | 123.456 |
512 | 123.456 |
513 | 123.456 |
514 | 123.456 |
928753ea |
515 | 123.456 |
516 | 123.456 |
928753ea |
517 | 123.456 |
7fd134d9 |
518 | -123.456 |
519 | -123.456 |
520 | -123.456 |
521 | -123.456 |
522 | 123456000000000 |
523 | 123456000000000 |
524 | 123456000000000 |
525 | 123456000000000 |
526 | 123456000000000 |
527 | 123456000000000 |
528 | 123456000000000 |
fbfa96bd |
529 | 1.23456e-0?10 |
530 | 1.23456e-0?10 |
531 | 1.23456e-0?10 |
532 | 1.23456e-0?10 |
b3b48e3e |
533 | 123 |
534 | 12.34 |
535 | 12340000000000 |
599cee73 |
536 | ######## |
537 | # toke.c |
e476b1b5 |
538 | use warnings 'bareword' ; |
60e6418e |
539 | #line 25 "bar" |
599cee73 |
540 | $a = FRED:: ; |
e476b1b5 |
541 | no warnings 'bareword' ; |
0453d815 |
542 | #line 25 "bar" |
543 | $a = FRED:: ; |
599cee73 |
544 | EXPECT |
60e6418e |
545 | Bareword "FRED::" refers to nonexistent package at bar line 25. |
599cee73 |
546 | ######## |
547 | # toke.c |
4438c4b7 |
548 | use warnings 'ambiguous' ; |
599cee73 |
549 | sub time {} |
0453d815 |
550 | my $a = time() ; |
4438c4b7 |
551 | no warnings 'ambiguous' ; |
0453d815 |
552 | my $b = time() ; |
599cee73 |
553 | EXPECT |
554 | Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. |
555 | ######## |
556 | # toke.c |
26d16222 |
557 | use warnings ; |
0453d815 |
558 | eval <<'EOE'; |
df0deb90 |
559 | # line 30 "foo" |
560 | warn "yelp"; |
0453d815 |
561 | { |
0453d815 |
562 | $_ = " \x{123} " ; |
563 | } |
564 | EOE |
565 | EXPECT |
df0deb90 |
566 | yelp at foo line 30. |
0453d815 |
567 | ######## |
568 | # toke.c |
0453d815 |
569 | my $a = rand + 4 ; |
570 | EXPECT |
571 | Warning: Use of "rand" without parens is ambiguous at - line 2. |
572 | ######## |
573 | # toke.c |
574 | $^W = 0 ; |
575 | my $a = rand + 4 ; |
576 | { |
4438c4b7 |
577 | no warnings 'ambiguous' ; |
0453d815 |
578 | $a = rand + 4 ; |
4438c4b7 |
579 | use warnings 'ambiguous' ; |
0453d815 |
580 | $a = rand + 4 ; |
581 | } |
582 | $a = rand + 4 ; |
583 | EXPECT |
584 | Warning: Use of "rand" without parens is ambiguous at - line 3. |
585 | Warning: Use of "rand" without parens is ambiguous at - line 8. |
586 | Warning: Use of "rand" without parens is ambiguous at - line 10. |
587 | ######## |
588 | # toke.c |
589 | sub fred {}; |
590 | -fred ; |
591 | EXPECT |
592 | Ambiguous use of -fred resolved as -&fred() at - line 3. |
593 | ######## |
594 | # toke.c |
595 | $^W = 0 ; |
596 | sub fred {} ; |
597 | -fred ; |
598 | { |
4438c4b7 |
599 | no warnings 'ambiguous' ; |
0453d815 |
600 | -fred ; |
4438c4b7 |
601 | use warnings 'ambiguous' ; |
0453d815 |
602 | -fred ; |
603 | } |
604 | -fred ; |
605 | EXPECT |
606 | Ambiguous use of -fred resolved as -&fred() at - line 4. |
607 | Ambiguous use of -fred resolved as -&fred() at - line 9. |
608 | Ambiguous use of -fred resolved as -&fred() at - line 11. |
609 | ######## |
610 | # toke.c |
611 | open FOO || time; |
612 | EXPECT |
613 | Precedence problem: open FOO should be open(FOO) at - line 2. |
614 | ######## |
615 | # toke.c |
616 | $^W = 0 ; |
617 | open FOO || time; |
618 | { |
e476b1b5 |
619 | no warnings 'precedence' ; |
0453d815 |
620 | open FOO || time; |
e476b1b5 |
621 | use warnings 'precedence' ; |
0453d815 |
622 | open FOO || time; |
623 | } |
624 | open FOO || time; |
625 | EXPECT |
626 | Precedence problem: open FOO should be open(FOO) at - line 3. |
627 | Precedence problem: open FOO should be open(FOO) at - line 8. |
628 | Precedence problem: open FOO should be open(FOO) at - line 10. |
629 | ######## |
630 | # toke.c |
631 | $^W = 0 ; |
632 | *foo *foo ; |
633 | { |
4438c4b7 |
634 | no warnings 'ambiguous' ; |
0453d815 |
635 | *foo *foo ; |
4438c4b7 |
636 | use warnings 'ambiguous' ; |
0453d815 |
637 | *foo *foo ; |
638 | } |
639 | *foo *foo ; |
640 | EXPECT |
641 | Operator or semicolon missing before *foo at - line 3. |
642 | Ambiguous use of * resolved as operator * at - line 3. |
643 | Operator or semicolon missing before *foo at - line 8. |
644 | Ambiguous use of * resolved as operator * at - line 8. |
645 | Operator or semicolon missing before *foo at - line 10. |
646 | Ambiguous use of * resolved as operator * at - line 10. |
767a6a26 |
647 | ######## |
648 | # toke.c |
e476b1b5 |
649 | use warnings 'misc' ; |
767a6a26 |
650 | my $a = "\m" ; |
e476b1b5 |
651 | no warnings 'misc' ; |
767a6a26 |
652 | $a = "\m" ; |
653 | EXPECT |
654 | Unrecognized escape \m passed through at - line 3. |
655 | ######## |
656 | # toke.c |
657 | use warnings 'portable' ; |
658 | my $a = 0b011111111111111111111111111111110 ; |
659 | $a = 0b011111111111111111111111111111111 ; |
660 | $a = 0b111111111111111111111111111111111 ; |
661 | $a = 0x0fffffffe ; |
662 | $a = 0x0ffffffff ; |
663 | $a = 0x1ffffffff ; |
664 | $a = 0037777777776 ; |
665 | $a = 0037777777777 ; |
666 | $a = 0047777777777 ; |
667 | no warnings 'portable' ; |
668 | $a = 0b011111111111111111111111111111110 ; |
669 | $a = 0b011111111111111111111111111111111 ; |
670 | $a = 0b111111111111111111111111111111111 ; |
671 | $a = 0x0fffffffe ; |
672 | $a = 0x0ffffffff ; |
673 | $a = 0x1ffffffff ; |
674 | $a = 0037777777776 ; |
675 | $a = 0037777777777 ; |
676 | $a = 0047777777777 ; |
677 | EXPECT |
678 | Binary number > 0b11111111111111111111111111111111 non-portable at - line 5. |
679 | Hexadecimal number > 0xffffffff non-portable at - line 8. |
680 | Octal number > 037777777777 non-portable at - line 11. |
681 | ######## |
682 | # toke.c |
683 | use warnings 'overflow' ; |
684 | my $a = 0b011111111111111111111111111111110 ; |
685 | $a = 0b011111111111111111111111111111111 ; |
15041a67 |
686 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 |
687 | $a = 0x0fffffffe ; |
688 | $a = 0x0ffffffff ; |
15041a67 |
689 | $a = 0x10000000000000000 ; |
767a6a26 |
690 | $a = 0037777777776 ; |
691 | $a = 0037777777777 ; |
15041a67 |
692 | $a = 002000000000000000000000; |
767a6a26 |
693 | no warnings 'overflow' ; |
694 | $a = 0b011111111111111111111111111111110 ; |
695 | $a = 0b011111111111111111111111111111111 ; |
15041a67 |
696 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 |
697 | $a = 0x0fffffffe ; |
698 | $a = 0x0ffffffff ; |
15041a67 |
699 | $a = 0x10000000000000000 ; |
767a6a26 |
700 | $a = 0037777777776 ; |
701 | $a = 0037777777777 ; |
15041a67 |
702 | $a = 002000000000000000000000; |
767a6a26 |
703 | EXPECT |
704 | Integer overflow in binary number at - line 5. |
705 | Integer overflow in hexadecimal number at - line 8. |
706 | Integer overflow in octal number at - line 11. |
8593bda5 |
707 | ######## |
708 | # toke.c |
ac206dc8 |
709 | BEGIN { $^C = 1; } |
710 | use warnings 'misc'; |
711 | dump; |
712 | CORE::dump; |
713 | EXPECT |
714 | dump() better written as CORE::dump() at - line 4. |
715 | - syntax OK |
716 | ######## |
717 | # toke.c |
718 | use warnings 'misc'; |
719 | use subs qw/dump/; |
720 | sub dump { print "no warning for overriden dump\n"; } |
721 | dump; |
722 | EXPECT |
723 | no warning for overriden dump |
724 | ######## |
725 | # toke.c |
8593bda5 |
726 | use warnings 'ambiguous'; |
727 | "@mjd_previously_unused_array"; |
728 | no warnings 'ambiguous'; |
729 | "@mjd_previously_unused_array"; |
730 | EXPECT |
731 | Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3. |
707afd92 |
732 | ######## |
733 | # toke.c |
734 | # The \q should warn, the \_ should NOT warn. |
735 | use warnings 'misc'; |
736 | "foo" =~ /\q/; |
737 | "bar" =~ /\_/; |
738 | no warnings 'misc'; |
739 | "foo" =~ /\q/; |
740 | "bar" =~ /\_/; |
741 | EXPECT |
742 | Unrecognized escape \q passed through at - line 4. |
4ac733c9 |
743 | ######## |
744 | # toke.c |
745 | # 20020328 mjd@plover.com at behest of jfriedl@yahoo.com |
746 | use warnings 'regexp'; |
747 | "foo" =~ /foo/c; |
748 | no warnings 'regexp'; |
749 | "foo" =~ /foo/c; |
750 | EXPECT |
751 | Use of /c modifier is meaningless without /g at - line 4. |
752 | ######## |
753 | # toke.c |
754 | # 20020328 mjd@plover.com at behest of jfriedl@yahoo.com |
755 | use warnings 'regexp'; |
756 | $_ = "ab" ; |
757 | s/ab/ab/c; |
758 | no warnings 'regexp'; |
759 | s/ab/ab/c; |
760 | EXPECT |
761 | Use of /c modifier is meaningless without /g at - line 5. |