summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
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
commit3c3f8cd64edb32a0dac554f7a524cc222184c3ec (patch)
treea75cb811c9660e61940c6d7529b62ee7e9777163 /mg.c
parent75debb79e45d698f62a32fcd7d1b020a8a677eda (diff)
downloadperl-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 'mg.c')
-rw-r--r--mg.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/mg.c b/mg.c
index c3de7f5519..58427a4863 100644
--- a/mg.c
+++ b/mg.c
@@ -2774,6 +2774,17 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
PerlMemShared_free(PL_compiling.cop_warnings);
PL_compiling.cop_warnings = pWARN_NONE;
}
+ /* Yuck. I can't see how to abstract this: */
+ else if (isWARN_on(
+ ((STRLEN *)SvPV_nolen_const(sv)) - 1,
+ WARN_ALL)
+ && !any_fatals)
+ {
+ if (!specialWARN(PL_compiling.cop_warnings))
+ PerlMemShared_free(PL_compiling.cop_warnings);
+ PL_compiling.cop_warnings = pWARN_ALL;
+ PL_dowarn |= G_WARN_ONCE ;
+ }
else {
STRLEN len;
const char *const p = SvPV_const(sv, len);