summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-12-19 16:03:39 -0700
committerKarl Williamson <khw@cpan.org>2018-01-19 11:20:11 -0700
commitba52ce15fe5ca68de1be69e394f41ccb48a731cc (patch)
tree12d167bb59e39ac5943c1a249f2cbe626170dfff /doop.c
parent78ba90076f5958f9830fb2559e21420018be4f8d (diff)
downloadperl-ba52ce15fe5ca68de1be69e394f41ccb48a731cc.tar.gz
Deprecate above \xFF in bitwise string ops
This is already a fatal error for operations whose outcome depends on them, but in things like "abc" & "def\x{100}" the wide character doesn't actually need to participate in the AND, and so perl doesn't. As a result of the discussion in the thread beginning with http://nntp.perl.org/group/perl.perl5.porters/244884, it was decided to deprecate these ones too.
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/doop.c b/doop.c
index f5a40efaae..afbbcdae5d 100644
--- a/doop.c
+++ b/doop.c
@@ -1095,6 +1095,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
* portion. That means that at least one of the operands has to be
* entirely non-UTF-8, and the length of that operand has to be before the
* first above-FF in the other */
+ if (left_utf8 || right_utf8) {
if (left_utf8) {
if (right_utf8 || rightlen > leftlen) {
Perl_croak(aTHX_ fatal_above_ff_msg, PL_op_desc[optype]);
@@ -1107,6 +1108,10 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
}
len = leftlen;
}
+
+ Perl_ck_warner_d(aTHX_ packWARN(WARN_DEPRECATED),
+ deprecated_above_ff_msg, PL_op_desc[optype]);
+ }
else { /* Neither is UTF-8 */
len = MIN(leftlen, rightlen);
}