Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions mg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3152,9 +3152,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
case '\027': /* ^W & $^WARNING_BITS */
if (*(mg->mg_ptr+1) == '\0') {
if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
i = SvIV(sv);
PL_dowarn = (PL_dowarn & ~G_WARN_ON)
| (i ? G_WARN_ON : G_WARN_OFF) ;
| (SvTRUE_NN(sv) ? G_WARN_ON : G_WARN_OFF) ;
}
}
else if (strEQ(mg->mg_ptr+1, "ARNING_BITS")) {
Expand Down
5 changes: 5 additions & 0 deletions t/lib/warnings/mg
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,8 @@ EXPECT
Use of uninitialized value $s in hash element at - line 13.
Use of uninitialized value $_[0] in defined operator at - line 10.
defined
########
# NAME undefined $^W shouldn't warn
use warnings;
undef $^W
EXPECT
2 changes: 1 addition & 1 deletion t/op/reset.t
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ SKIP:
my $warn = '';
local $SIG{__WARN__} = sub { $warn .= "@_\n" };
reset "\cW";
like($warn, qr/uninitialized/, "magic tries to SvIV() the new value");
is($warn, "", 'no warnings resetting $^W');
$warn = '';
is($^W, 0, q"check $^W has been zeroed");
is($warn, '', "should be no more warnings");
Expand Down
Loading