regcomp.c: Change warning category to just deprecated
authorKarl Williamson <public@khwilliamson.com>
Tue, 22 Jan 2013 18:16:59 +0000 (11:16 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 24 Jan 2013 02:35:33 +0000 (19:35 -0700)
The warnings for \b{ and \B{ were added in the 5.17 series; they are a
deprecation warning which should be turned off by that category.  One
should not have to turn off regular regexp warnings as well to get rid
of these.

regcomp.c
t/lib/warnings/regcomp

index a16b8b3..6299a4d 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -548,6 +548,13 @@ static const scan_data_t zero_scan_data =
            (int)offset, RExC_precomp, RExC_precomp + offset);          \
 } STMT_END
 
+#define        ckWARNdep(loc,m) STMT_START {                                   \
+    const IV offset = loc - RExC_precomp;                              \
+    Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),                  \
+           m REPORT_LOCATION,                                          \
+           (int)offset, RExC_precomp, RExC_precomp + offset);          \
+} STMT_END
+
 #define        ckWARNregdep(loc,m) STMT_START {                                \
     const IV offset = loc - RExC_precomp;                              \
     Perl_ck_warner_d(aTHX_ packWARN2(WARN_DEPRECATED, WARN_REGEXP),    \
@@ -10251,7 +10258,7 @@ tryagain:
            FLAGS(ret) = get_regex_charset(RExC_flags);
            *flagp |= SIMPLE;
            if (! SIZE_ONLY && (U8) *(RExC_parse + 1) == '{') {
-               ckWARNregdep(RExC_parse, "\"\\b{\" is deprecated; use \"\\b\\{\" instead");
+               ckWARNdep(RExC_parse, "\"\\b{\" is deprecated; use \"\\b\\{\" instead");
            }
            goto finish_meta_pat;
        case 'B':
@@ -10265,7 +10272,7 @@ tryagain:
            FLAGS(ret) = get_regex_charset(RExC_flags);
            *flagp |= SIMPLE;
            if (! SIZE_ONLY && (U8) *(RExC_parse + 1) == '{') {
-               ckWARNregdep(RExC_parse, "\"\\B{\" is deprecated; use \"\\B\\{\" instead");
+               ckWARNdep(RExC_parse, "\"\\B{\" is deprecated; use \"\\B\\{\" instead");
            }
            goto finish_meta_pat;
 
index 20ee8cf..340a366 100644 (file)
@@ -56,13 +56,13 @@ Unrecognized escape \m passed through in regex; marked by <-- HERE in m/a\m <--
 ########
 # regcomp.c [S_regatom]
 # The \q should warn, the \_ should NOT warn.
-use warnings 'regexp'; no warnings "deprecated";
+use warnings qw(regexp deprecated);
 "foo" =~ /\q/;
 "foo" =~ /\q{/;
 "foo" =~ /a\b{cde/;
 "foo" =~ /a\B{cde/;
 "bar" =~ /\_/;
-no warnings 'regexp';
+no warnings qw(regexp deprecated);
 "foo" =~ /\q/;
 "foo" =~ /\q{/;
 "foo" =~ /a\b{cde/;