diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-03-04 22:23:41 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-03-04 22:23:41 +0000 |
commit | 75b6c4caab1abb3506eab9e8e512c69bbeb1c49f (patch) | |
tree | db7e5e70081c15524e3f4de91ac64c8fca63575f /mg.c | |
parent | 8fa7688f7865696bdfa78bc12d4ffb78bd1d6103 (diff) | |
download | perl-75b6c4caab1abb3506eab9e8e512c69bbeb1c49f.tar.gz |
Patch by Salvador FandiƱo to read the warning mask
returned by caller() and ${^WARNING_BITS} from
$warnings::Bits{all} and not from the hardcoded core
constant. (This mask could have been extended by
warnings::register.) Plus tests.
p4raw-id: //depot/perl@18829
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -676,7 +676,16 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) sv_setpvn(sv, WARN_NONEstring, WARNsize) ; } else if (PL_compiling.cop_warnings == pWARN_ALL) { - sv_setpvn(sv, WARN_ALLstring, WARNsize) ; + /* Get the bit mask for $warnings::Bits{all}, because + * it could have been extended by warnings::register */ + SV **bits_all; + HV *bits=get_hv("warnings::Bits", FALSE); + if (bits && (bits_all=hv_fetch(bits, "all", 3, FALSE))) { + sv_setsv(sv, *bits_all); + } + else { + sv_setpvn(sv, WARN_ALLstring, WARNsize) ; + } } else { sv_setsv(sv, PL_compiling.cop_warnings); |