summaryrefslogtreecommitdiff
path: root/util.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 /util.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 'util.c')
-rw-r--r--util.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/util.c b/util.c
index 67136fe6e3..fbccd8a97c 100644
--- a/util.c
+++ b/util.c
@@ -1944,13 +1944,8 @@ bool
Perl_ckwarn(pTHX_ U32 w)
{
/* If lexical warnings have not been set, use $^W. */
- if (isLEXWARN_off) {
- /* TODO: Hardcoding this here sucks, see the commit that added this */
- if (w == WARN_VOID_UNUSUAL)
- return FALSE;
- else
- return PL_dowarn & G_WARN_ON;
- }
+ if (isLEXWARN_off)
+ return PL_dowarn & G_WARN_ON;
return ckwarn_common(w);
}
@@ -1961,13 +1956,8 @@ bool
Perl_ckwarn_d(pTHX_ U32 w)
{
/* If lexical warnings have not been set then default classes warn. */
- if (isLEXWARN_off) {
- /* TODO: Hardcoding this here sucks, see the commit that added this */
- if (w == WARN_VOID_UNUSUAL)
- return FALSE;
- else
- return TRUE;
- }
+ if (isLEXWARN_off)
+ return TRUE;
return ckwarn_common(w);
}
@@ -1975,13 +1965,8 @@ Perl_ckwarn_d(pTHX_ U32 w)
static bool
S_ckwarn_common(pTHX_ U32 w)
{
- if (PL_curcop->cop_warnings == pWARN_ALL) {
- /* TODO: Hardcoding this here sucks, see the commit that added this */
- if (w == WARN_VOID_UNUSUAL)
- return FALSE;
- else
- return TRUE;
- }
+ if (PL_curcop->cop_warnings == pWARN_ALL)
+ return TRUE;
if (PL_curcop->cop_warnings == pWARN_NONE)
return FALSE;