diff options
author | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2015-01-25 14:10:13 +0000 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avar@cpan.org> | 2015-01-25 15:16:21 +0000 |
commit | 3c3f8cd64edb32a0dac554f7a524cc222184c3ec (patch) | |
tree | a75cb811c9660e61940c6d7529b62ee7e9777163 /t | |
parent | 75debb79e45d698f62a32fcd7d1b020a8a677eda (diff) | |
download | perl-3c3f8cd64edb32a0dac554f7a524cc222184c3ec.tar.gz |
Revert the support for new warning categories outside of "all"
This reverts & amends my v5.21.7-151-gea5519d and Karl Williamson's
v5.21.7-183-g2f3cbe1, the latter was only need because of the
former.
I've also taken the opportunity to fix the long-standing trivial bug
with misaligned code in warnings.{pm,h}. That was easier to commit along
with this than to split it up from the other generated changes.
Why revert this? See the "use warnings 'absolutely-all-almost';" thread
on perl5-porters for the latest summary:
http://www.nntp.perl.org/group/perl.perl5.porters/2015/01/msg225066.html
Basically as I explained in v5.21.7-151-gea5519d the current design of
the API makes it too contentious to freely add new warnings, but there's
no consensus on how to solve that. I.e. whether we should just add them
to "all", or do this change, or several other possible things outlined
in that thread and elsewhere.
Since the deadline for contentious changes for v5.22 is already past us
I'm backing this out for now.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/op | 13 | ||||
-rw-r--r-- | t/op/caller.t | 5 |
2 files changed, 4 insertions, 14 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 009a10285c..2ca9edfe42 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -417,7 +417,7 @@ $a <=> $b; # OP_NCMP use 5.015; __SUB__ ; # OP_RUNCV []; # OP_ANONLIST -grep /42/, (1,2); # OP_GREP, not warned about, in the "everything" & "void_unusual" category +grep /42/, (1,2); # OP_GREP. Not warned about (yet). Grep git logs for void_unusual to see why... EXPECT Useless use of a constant ("111") in void context at - line 2. Useless use of repeat (x) in void context at - line 3. @@ -467,17 +467,6 @@ Useless use of __SUB__ in void context at - line 61. Useless use of anonymous array ([]) in void context at - line 62. ######## # op.c -use warnings 'void_unusual' ; close STDIN ; -grep /42/, (1,2); # OP_GREP -no warnings 'void_unusual'; -grep /42/, (1,2); # OP_GREP -use warnings 'everything'; -grep /42/, (1,2); # OP_GREP -EXPECT -Unusual use of grep in void context at - line 3. -Unusual use of grep in void context at - line 7. -######## -# op.c use warnings 'void' ; close STDIN ; my $x = sort (2,1,3); no warnings 'void' ; diff --git a/t/op/caller.t b/t/op/caller.t index 760c412e57..6e56d67a8d 100644 --- a/t/op/caller.t +++ b/t/op/caller.t @@ -106,14 +106,15 @@ sub testwarn { vec($default, $i, 2) = 1; } $registered = $default; + vec($registered, $warnings::LAST_BIT/2, 2) = 1; } BEGIN { check_bits( ${^WARNING_BITS}, "\0" x $warnings::BYTES, 'all bits off via "no warnings"' ) } testwarn("\0" x $warnings::BYTES, 'no bits'); - use warnings qw(everything); + use warnings; BEGIN { check_bits( ${^WARNING_BITS}, $default, - 'all bits on via "use warnings qw(everything)"' ); } + 'default bits on via "use warnings"' ); } BEGIN { testwarn($default, 'all'); } # run-time : # the warning mask has been extended by warnings::register |