summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorAbigail <abigail@abigail.be>2017-01-13 20:29:58 +0100
committerAbigail <abigail@abigail.be>2017-01-16 19:18:15 +0100
commitbfdc8cd3d5a81ab176f7d530d2e692897463c97d (patch)
tree685451f2fd81a09edcf0893ef2042a13502894f9 /regcomp.c
parent838ba4df5dc7a6ea548005412fcf40feb86d2078 (diff)
downloadperl-bfdc8cd3d5a81ab176f7d530d2e692897463c97d.tar.gz
Deprecating the use of C<< \cI<X> >> to specify a printable character.
Starting in 5.14, we deprecated the use of "\cI<X>" when this results in a printable character. For instance, "\c:" is just a fancy way of writing "z". Starting in 5.28, this will be a fatal error. This also includes certain usage in regular expressions with the experimental (?[ ]) construct, or when "use re 'strict'" is in effect (also experimental).
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/regcomp.c b/regcomp.c
index 27e9dc22ba..d865c73c06 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -819,6 +819,13 @@ static const scan_data_t zero_scan_data =
REPORT_LOCATION_ARGS(loc)); \
} STMT_END
+#define vWARN4dep(loc, m, a1, a2, a3) STMT_START { \
+ __ASSERT_(PASS2) Perl_warner(aTHX_ packWARN2(WARN_REGEXP,WARN_DEPRECATED), \
+ m REPORT_LOCATION, \
+ a1, a2, a3, \
+ REPORT_LOCATION_ARGS(loc)); \
+} STMT_END
+
#define ckWARN4reg(loc, m, a1, a2, a3) STMT_START { \
__ASSERT_(PASS2) Perl_ck_warner(aTHX_ packWARN(WARN_REGEXP), \
m REPORT_LOCATION, \
@@ -16866,20 +16873,22 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
literal[d++] = (char) value;
literal[d++] = '\0';
- vWARN4(RExC_parse,
- "\"%.*s\" is more clearly written simply as \"%s\"",
+ vWARN4dep(RExC_parse,
+ "\"%.*s\" is more clearly written simply as \"%s\". "
+ "This will be a fatal error in Perl 5.28",
(int) (RExC_parse - rangebegin),
rangebegin,
literal
- );
+ );
}
else if isMNEMONIC_CNTRL(value) {
- vWARN4(RExC_parse,
- "\"%.*s\" is more clearly written simply as \"%s\"",
+ vWARN4dep(RExC_parse,
+ "\"%.*s\" is more clearly written simply as \"%s\". "
+ "This will be a fatal error in Perl 5.28",
(int) (RExC_parse - rangebegin),
rangebegin,
cntrl_to_mnemonic((U8) value)
- );
+ );
}
}
}