diff options
author | Yves Orton <demerphq@gmail.com> | 2023-02-25 15:21:14 +0100 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-03-18 21:00:54 +0800 |
commit | d81b4f9331172ed96e5382fe1e1091e9d4b85495 (patch) | |
tree | a34de6f2d0c902c72aede41423528afaca271a36 /lib | |
parent | 905584a6fe44cfcb198cc15af5e082ceb57ccf85 (diff) | |
download | perl-d81b4f9331172ed96e5382fe1e1091e9d4b85495.tar.gz |
warnings.pm - support deprecated::smartmatch category
Currently we seem to lack a way to have a subcategory under deprecated.
It seems reasonable to me that people might want to disable a specific
subcategory warning while leaving the rest in place. This patch allows
that. Note that both
no warnings "deprecated";
and
no warnings "deprecated::smartmatch";
work to disable the warning. Deprecated warnings shouldn't be "all or
nothing", they should be specific and targetted.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/warnings.pm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm index 2dd9eccb51..083dbb4fca 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -112,6 +112,9 @@ our %Offsets = ( # Warnings Categories added in Perl 5.037 'experimental::class' => 144, + + # Warnings Categories added in Perl 5.037009 + 'deprecated::smartmatch' => 146, ); our %Bits = ( @@ -121,7 +124,8 @@ our %Bits = ( 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] - 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] + 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [2,73] + 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [73] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] @@ -197,7 +201,8 @@ our %DeadBits = ( 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] - 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] + 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [2,73] + 'deprecated::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [73] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] @@ -279,8 +284,8 @@ our %NoOp = ( # These are used by various things, including our own tests our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x50\x05\x51\x55\x15\x01"; # [2,4,22,23,25,54..57,60,62..70,72] -our $LAST_BIT = 146 ; +our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x50\x05\x51\x55\x15\x05"; # [2,4,22,23,25,54..57,60,62..70,72,73] +our $LAST_BIT = 148 ; our $BYTES = 19 ; sub Croaker @@ -881,7 +886,9 @@ The current hierarchy is: | +- closure | - +- deprecated + +- deprecated ----+ + | | + | +- deprecated::smartmatch | +- exiting | |