diff options
author | Hauke D <haukex@zero-g.net> | 2014-01-13 00:50:51 +0100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-01-22 16:32:14 +1100 |
commit | c91312d5e67fd262ccd6f36ff40ddbca6896d004 (patch) | |
tree | 95057cfca0a55d90b2a3af13205b44701698c773 /regen | |
parent | e214621be67f417c619e2038fcb4742892fde1b1 (diff) | |
download | perl-c91312d5e67fd262ccd6f36ff40ddbca6896d004.tar.gz |
assume "all" in "use warnings 'FATAL';" and related
Until now, the behavior of the statements
use warnings "FATAL";
use warnings "NONFATAL";
no warnings "FATAL";
was unspecified and inconsistent. This change causes them to be handled
with an implied "all" at the end of the import list.
Tony Cook: fix AUTHORS formatting
Diffstat (limited to 'regen')
-rw-r--r-- | regen/warnings.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/regen/warnings.pl b/regen/warnings.pl index 27e4d5003d..388b8a7858 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -693,6 +693,9 @@ sub import $mask |= $Bits{'all'} ; $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); } + + # append 'all' when implied (after a lone "FATAL" or "NONFATAL") + push @_, 'all' if @_==1 && ( $_[0] eq 'FATAL' || $_[0] eq 'NONFATAL' ); # Empty @_ is equivalent to @_ = 'all' ; ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ; @@ -710,7 +713,8 @@ sub unimport $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); } - push @_, 'all' unless @_; + # append 'all' when implied (empty import list or after a lone "FATAL") + push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL'; foreach my $word ( @_ ) { if ($word eq 'FATAL') { |