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