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