diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-05-27 00:17:09 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-05-27 00:50:03 -0700 |
commit | 94ec3a20140bf33f6d73b0b11cfd26c813f60601 (patch) | |
tree | baa307875bb10e6bd744dae3076d381fd550eb6f /toke.c | |
parent | 3036c853dc4dc12432488679779401c20ddfb64b (diff) | |
download | perl-94ec3a20140bf33f6d73b0b11cfd26c813f60601.tar.gz |
Make \N{ } deprecation warnings fatalizable
What drew my attention to this was the missing category in
perldiag.pod. I tried adding it, but diag.t complained that it should
be absent.
It thinks it should be absent, because Perl_warn (when used correctly)
does not put the warning in any category, and does not allow it to be
suppressed except via $SIG{__WARN__}.
Use of if(ckWARN) followed by Perl_warn is not correct. ckWARN checks
to see whether the category is enabled, and then Perl_warn warns with-
out reference to the category at all, so whether it is fatal cannot
be looked up.
The result is that these warnings do not die under ‘use warnings
FATAL => 'deprecated'’.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -2729,12 +2729,16 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) goto bad_charname; } if (*s == ' ' && *(s-1) == ' ' && ckWARN_d(WARN_DEPRECATED)) { - Perl_warn(aTHX_ "A sequence of multiple spaces in a charnames alias definition is deprecated"); + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "A sequence of multiple spaces in a charnames " + "alias definition is deprecated"); } s++; } if (*(s-1) == ' ' && ckWARN_d(WARN_DEPRECATED)) { - Perl_warn(aTHX_ "Trailing white-space in a charnames alias definition is deprecated"); + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "Trailing white-space in a charnames alias " + "definition is deprecated"); } } else { @@ -2773,7 +2777,9 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) } if (*s == ' ' && *(s-1) == ' ' && ckWARN_d(WARN_DEPRECATED)) { - Perl_warn(aTHX_ "A sequence of multiple spaces in a charnames alias definition is deprecated"); + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "A sequence of multiple spaces in a charnam" + "es alias definition is deprecated"); } s++; } @@ -2800,7 +2806,9 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) } } if (*(s-1) == ' ' && ckWARN_d(WARN_DEPRECATED)) { - Perl_warn(aTHX_ "Trailing white-space in a charnames alias definition is deprecated"); + Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), + "Trailing white-space in a charnames alias " + "definition is deprecated"); } } |