clearer[i++] = result;
clearer[i++] = '\0';
- Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX),
- "\"\\c%c\" is more clearly written simply as \"%s\"",
- source,
- clearer);
+ Perl_ck_warner_d(aTHX_ packWARN2(WARN_SYNTAX,WARN_DEPRECATED),
+ "\"\\c%c\" is more clearly written simply as \"%s\". "
+ "This will be a fatal error in Perl 5.28",
+ source, clearer);
}
return result;
This feature was deprecated in Perl 5.004, and will be fatal in Perl 5.28.
+=head3 Use of C<< \cI<X> >> to specify a printable character.
+
+In a double quoted context, Perl has the C<< \c >> construct to write
+control characters in a readable way. For instance, the tab character
+can be written as C<< \cI >> (I<< control-I >>), and the escape
+character can be written as C<< \c[ >>.
+
+Due to implementation details, the C<< \c >> construct can be used
+to create regular, printable, characters as well. For instance,
+C<< \c >> maps a C<< , >> to C<< l >>; that is C<< \c, >> is an
+obscure way of writing C<< l >>. And not only that, it's also not
+portable between ASCII and EBCDIC platforms.
+
+Using the C<< \c >> construct with an argument which maps to a
+printable character was deprecated in Perl 5.14, and will be a fatal
+error in Perl 5.28. You're recommended to just write the intended
+character instead.
+
+
+
=head2 Perl 5.26
=head3 C<< --libpods >> in C<< Pod::Html >>
Note that ASCII characters that don't map to control characters are
discouraged, and will generate the warning (when enabled)
-L</""\c%c" is more clearly written simply as "%s"">.
+L</""\c%c" is more clearly written simply as "%s". This will be a fatal error in Perl 5.28">.
=item Character following \%c must be '{' or a single-character Unicode property name in regex; marked by <-- HERE in m/%s/
(W unopened) You tried chdir() on a filehandle that was never opened.
-=item "\c%c" is more clearly written simply as "%s"
+=item "\c%c" is more clearly written simply as "%s". This will be a fatal error in Perl 5.28
-(W syntax) The C<\cI<X>> construct is intended to be a way to specify
-non-printable characters. You used it for a printable one, which
-is better written as simply itself, perhaps preceded by a backslash
-for non-word characters. Doing it the way you did is not portable
-between ASCII and EBCDIC platforms.
+(D deprecated, syntax) The C<\cI<X>> construct is intended to be a
+way to specify non-printable characters. You used it for a printable
+one, which is better written as simply itself, perhaps preceded by
+a backslash for non-word characters. Doing it the way you did is
+not portable between ASCII and EBCDIC platforms.
+
+This usage is going to result in a fatal error in Perl 5.28.
=item Cloning substitution context is unimplemented
any of sysread(), recv(), syswrite() or send() are called on handle with the
C<:utf8> layer.
-=item "%s" is more clearly written simply as "%s" in regex; marked by S<<-- HERE> in m/%s/
-
-(W regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
+=item "%s" is more clearly written simply as "%s" in regex. This will be a fatal error in Perl 5.28; marked by S<<-- HERE> in m/%s/
-You specified a character that has the given plainer way of writing it,
-and which is also portable to platforms running with different character
-sets.
+(W deprecated, regexp) (only under C<S<use re 'strict'>> or within C<(?[...])>)
+The C<\cI<X>> construct is intended to be a way to specify non-printable
+characters. You used it for a printable one, which is better written
+as simply itself, perhaps preceded by a backslash for non-word
+characters. Doing it the way you did is not portable between ASCII
+and EBCDIC platforms.
=item '%s' is not a code reference
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, \
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)
- );
+ );
}
}
}
use warnings;
$a = qr/\c,/;
$a = qr/[\c,]/;
-no warnings 'syntax';
+no warnings 'syntax', 'deprecated';
$a = qr/\c,/;
$a = qr/[\c,]/;
EXPECT
-"\c," is more clearly written simply as "l" at - line 9.
-"\c," is more clearly written simply as "l" at - line 10.
+"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 9.
+"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 10.
########
# This is because currently a different error is output under
# use re 'strict', so can't go in reg_mesg.t
use warnings;
$a = "\c,";
$a = "\c`";
-no warnings 'syntax';
+no warnings 'syntax', 'deprecated';
$a = "\c,";
$a = "\c`";
EXPECT
-"\c," is more clearly written simply as "l" at - line 9.
-"\c`" is more clearly written simply as "\ " at - line 10.
+"\c," is more clearly written simply as "l". This will be a fatal error in Perl 5.28 at - line 9.
+"\c`" is more clearly written simply as "\ ". This will be a fatal error in Perl 5.28 at - line 10.
########
# toke.c
BEGIN {
],
'/a{1,1}?\x{100}/' => 'Useless use of greediness modifier \'?\' {#} m/a{1,1}?{#}\x{100}/',
"/(?[ [ % - % ] ])/" => "",
- "/(?[ [ : - \\x$colon_hex ] ])\\x{100}/" => "\": - \\x$colon_hex \" is more clearly written simply as \":\" {#} m/(?[ [ : - \\x$colon_hex {#}] ])\\x{100}/",
- "/(?[ [ \\x$colon_hex - : ] ])\\x{100}/" => "\"\\x$colon_hex\ - : \" is more clearly written simply as \":\" {#} m/(?[ [ \\x$colon_hex - : {#}] ])\\x{100}/",
- "/(?[ [ \\t - \\x$tab_hex ] ])\\x{100}/" => "\"\\t - \\x$tab_hex \" is more clearly written simply as \"\\t\" {#} m/(?[ [ \\t - \\x$tab_hex {#}] ])\\x{100}/",
- "/(?[ [ \\x$tab_hex - \\t ] ])\\x{100}/" => "\"\\x$tab_hex\ - \\t \" is more clearly written simply as \"\\t\" {#} m/(?[ [ \\x$tab_hex - \\t {#}] ])\\x{100}/",
+ "/(?[ [ : - \\x$colon_hex ] ])\\x{100}/" => "\": - \\x$colon_hex \" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ : - \\x$colon_hex {#}] ])\\x{100}/",
+ "/(?[ [ \\x$colon_hex - : ] ])\\x{100}/" => "\"\\x$colon_hex\ - : \" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\x$colon_hex - : {#}] ])\\x{100}/",
+ "/(?[ [ \\t - \\x$tab_hex ] ])\\x{100}/" => "\"\\t - \\x$tab_hex \" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\t - \\x$tab_hex {#}] ])\\x{100}/",
+ "/(?[ [ \\x$tab_hex - \\t ] ])\\x{100}/" => "\"\\x$tab_hex\ - \\t \" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/(?[ [ \\x$tab_hex - \\t {#}] ])\\x{100}/",
"/(?[ [ $B_hex - C ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ $B_hex - C {#}] ])/",
"/(?[ [ A - $B_hex ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ A - $B_hex {#}] ])/",
"/(?[ [ $low_mixed_alpha - $high_mixed_alpha ] ])/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/(?[ [ $low_mixed_alpha - $high_mixed_alpha {#}] ])/",
'/[\N{U+FF}-\x{100}]/' => 'Both or neither range ends should be Unicode {#} m/[\N{U+FF}-\x{100}{#}]/',
'/[\N{U+100}-\x{101}]/' => "",
"/[%-%]/" => "",
- "/[:-\\x$colon_hex]\\x{100}/" => "\":-\\x$colon_hex\" is more clearly written simply as \":\" {#} m/[:-\\x$colon_hex\{#}]\\x{100}/",
- "/[\\x$colon_hex-:]\\x{100}/" => "\"\\x$colon_hex-:\" is more clearly written simply as \":\" {#} m/[\\x$colon_hex\-:{#}]\\x{100}/",
- "/[\\t-\\x$tab_hex]\\x{100}/" => "\"\\t-\\x$tab_hex\" is more clearly written simply as \"\\t\" {#} m/[\\t-\\x$tab_hex\{#}]\\x{100}/",
- "/[\\x$tab_hex-\\t]\\x{100}/" => "\"\\x$tab_hex-\\t\" is more clearly written simply as \"\\t\" {#} m/[\\x$tab_hex\-\\t{#}]\\x{100}/",
+ "/[:-\\x$colon_hex]\\x{100}/" => "\":-\\x$colon_hex\" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/[:-\\x$colon_hex\{#}]\\x{100}/",
+ "/[\\x$colon_hex-:]\\x{100}/" => "\"\\x$colon_hex-:\" is more clearly written simply as \":\". This will be a fatal error in Perl 5.28 {#} m/[\\x$colon_hex\-:{#}]\\x{100}/",
+ "/[\\t-\\x$tab_hex]\\x{100}/" => "\"\\t-\\x$tab_hex\" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/[\\t-\\x$tab_hex\{#}]\\x{100}/",
+ "/[\\x$tab_hex-\\t]\\x{100}/" => "\"\\x$tab_hex-\\t\" is more clearly written simply as \"\\t\". This will be a fatal error in Perl 5.28 {#} m/[\\x$tab_hex\-\\t{#}]\\x{100}/",
"/[$B_hex-C]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[$B_hex-C{#}]/",
"/[A-$B_hex]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[A-$B_hex\{#}]/",
"/[$low_mixed_alpha-$high_mixed_alpha]/" => "Ranges of ASCII printables should be some subset of \"0-9\", \"A-Z\", or \"a-z\" {#} m/[$low_mixed_alpha-$high_mixed_alpha\{#}]/",