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