From 143aeb9644f9cee7142b1c298628de5f07c4d27b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 20 Dec 2012 09:39:22 -0700 Subject: [PATCH] Deprecate all is_(uni|utf8)_foo function uses Coders should use the macros in handy.h instead of calling these directly. --- embed.fnc | 58 +++++++++++++++++++++++++++---------------------------- pod/perldelta.pod | 32 ++++++++++++++++++++++++++++++ proto.h | 29 ++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 29 deletions(-) diff --git a/embed.fnc b/embed.fnc index 0ec56cd..0ad711f 100644 --- a/embed.fnc +++ b/embed.fnc @@ -605,20 +605,20 @@ XopR |I32 |was_lvalue_sub ADMpPR |U32 |to_uni_upper_lc|U32 c ADMpPR |U32 |to_uni_title_lc|U32 c ADMpPR |U32 |to_uni_lower_lc|U32 c -AMpPR |bool |is_uni_alnum |UV c -AMpPR |bool |is_uni_alnumc |UV c -AMpPR |bool |is_uni_idfirst |UV c -AMpPR |bool |is_uni_alpha |UV c +ADMpPR |bool |is_uni_alnum |UV c +ADMpPR |bool |is_uni_alnumc |UV c +ADMpPR |bool |is_uni_idfirst |UV c +ADMpPR |bool |is_uni_alpha |UV c ADMpPR |bool |is_uni_ascii |UV c ADMpPR |bool |is_uni_blank |UV c ADMpPR |bool |is_uni_space |UV c ADMpPR |bool |is_uni_cntrl |UV c -AMpPR |bool |is_uni_graph |UV c -AMpPR |bool |is_uni_digit |UV c -AMpPR |bool |is_uni_upper |UV c -AMpPR |bool |is_uni_lower |UV c -AMpPR |bool |is_uni_print |UV c -AMpPR |bool |is_uni_punct |UV c +ADMpPR |bool |is_uni_graph |UV c +ADMpPR |bool |is_uni_digit |UV c +ADMpPR |bool |is_uni_upper |UV c +ADMpPR |bool |is_uni_lower |UV c +ADMpPR |bool |is_uni_print |UV c +ADMpPR |bool |is_uni_punct |UV c ADMpPR |bool |is_uni_xdigit |UV c AMp |UV |to_uni_upper |UV c|NN U8 *p|NN STRLEN *lenp AMp |UV |to_uni_title |UV c|NN U8 *p|NN STRLEN *lenp @@ -634,21 +634,21 @@ p |UV |_to_upper_title_latin1|const U8 c|NN U8 *p|NN STRLEN *lenp|const char S_o AMp |UV |to_uni_lower |UV c|NN U8 *p|NN STRLEN *lenp AMmp |UV |to_uni_fold |UV c|NN U8 *p|NN STRLEN *lenp AMp |UV |_to_uni_fold_flags|UV c|NN U8 *p|NN STRLEN *lenp|const U8 flags -AMpPR |bool |is_uni_alnum_lc|UV c -AMpPR |bool |is_uni_alnumc_lc|UV c +ADMpPR |bool |is_uni_alnum_lc|UV c +ADMpPR |bool |is_uni_alnumc_lc|UV c ADMpPR |bool |is_uni_idfirst_lc|UV c AMpR |bool |_is_uni_perl_idstart|UV c -AMpPR |bool |is_uni_alpha_lc|UV c +ADMpPR |bool |is_uni_alpha_lc|UV c ADMpPR |bool |is_uni_ascii_lc|UV c ADMpPR |bool |is_uni_space_lc|UV c ADMpPR |bool |is_uni_blank_lc|UV c ADMpPR |bool |is_uni_cntrl_lc|UV c -AMpPR |bool |is_uni_graph_lc|UV c -AMpPR |bool |is_uni_digit_lc|UV c -AMpPR |bool |is_uni_upper_lc|UV c -AMpPR |bool |is_uni_lower_lc|UV c -AMpPR |bool |is_uni_print_lc|UV c -AMpPR |bool |is_uni_punct_lc|UV c +ADMpPR |bool |is_uni_graph_lc|UV c +ADMpPR |bool |is_uni_digit_lc|UV c +ADMpPR |bool |is_uni_upper_lc|UV c +ADMpPR |bool |is_uni_lower_lc|UV c +ADMpPR |bool |is_uni_print_lc|UV c +ADMpPR |bool |is_uni_punct_lc|UV c ADMpPR |bool |is_uni_xdigit_lc|UV c Anpd |bool |is_ascii_string|NN const U8 *s|STRLEN len AnpdD |STRLEN |is_utf8_char |NN const U8 *s @@ -658,30 +658,30 @@ Anpdmb |bool |is_utf8_string_loc|NN const U8 *s|STRLEN len|NULLOK const U8 **ep Anpd |bool |is_utf8_string_loclen|NN const U8 *s|STRLEN len|NULLOK const U8 **ep|NULLOK STRLEN *el AMpR |bool |_is_uni_FOO|const U8 classnum|const UV c AMpR |bool |_is_utf8_FOO|const U8 classnum|NN const U8 *p -AMpR |bool |is_utf8_alnum |NN const U8 *p -AMpR |bool |is_utf8_alnumc |NN const U8 *p +ADMpR |bool |is_utf8_alnum |NN const U8 *p +ADMpR |bool |is_utf8_alnumc |NN const U8 *p ADMpR |bool |is_utf8_idfirst|NN const U8 *p ADMpR |bool |is_utf8_xidfirst|NN const U8 *p AMpR |bool |_is_utf8_perl_idstart|NN const U8 *p ADMpR |bool |is_utf8_idcont |NN const U8 *p ADMpR |bool |is_utf8_xidcont |NN const U8 *p -AMpR |bool |is_utf8_alpha |NN const U8 *p +ADMpR |bool |is_utf8_alpha |NN const U8 *p ADMpR |bool |is_utf8_ascii |NN const U8 *p ADMpR |bool |is_utf8_blank |NN const U8 *p ADMpR |bool |is_utf8_space |NN const U8 *p ADMpR |bool |is_utf8_perl_space |NN const U8 *p ADMpR |bool |is_utf8_perl_word |NN const U8 *p ADMpR |bool |is_utf8_cntrl |NN const U8 *p -AMpR |bool |is_utf8_digit |NN const U8 *p +ADMpR |bool |is_utf8_digit |NN const U8 *p ADMpR |bool |is_utf8_posix_digit |NN const U8 *p -AMpR |bool |is_utf8_graph |NN const U8 *p -AMpR |bool |is_utf8_upper |NN const U8 *p -AMpR |bool |is_utf8_lower |NN const U8 *p -AMpR |bool |is_utf8_print |NN const U8 *p -AMpR |bool |is_utf8_punct |NN const U8 *p +ADMpR |bool |is_utf8_graph |NN const U8 *p +ADMpR |bool |is_utf8_upper |NN const U8 *p +ADMpR |bool |is_utf8_lower |NN const U8 *p +ADMpR |bool |is_utf8_print |NN const U8 *p +ADMpR |bool |is_utf8_punct |NN const U8 *p ADMpR |bool |is_utf8_xdigit |NN const U8 *p -AMpR |bool |is_utf8_mark |NN const U8 *p AMpR |bool |_is_utf8_mark |NN const U8 *p +ADMpR |bool |is_utf8_mark |NN const U8 *p : Used in perly.y p |OP* |jmaybe |NN OP *o : Used in pp.c diff --git a/pod/perldelta.pod b/pod/perldelta.pod index aea3c49..64f4089 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -53,6 +53,38 @@ an updated module in the L section. [ List each deprecation as a =head2 entry ] +=head2 Various XS-callable functions are now deprecated + +All the functions used to classify characters will be removed from a +future version of Perl, and should not be used. With participating C +compilers (e.g., gcc), compiling any file that uses any of these will +generate a warning. These were not intended for public use; there are +equivalent, faster, macros for most of them. +See L. The complete list (including some +that were deprecated in 5.17.7) is: +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C, C, +C, C. + +In addition these three functions that have never worked properly are +deprecated: +C, C, and C. + =head1 Performance Enhancements XXX Changes which enhance performance without changing behaviour go here. diff --git a/proto.h b/proto.h index e07eacd..d27d8b1 100644 --- a/proto.h +++ b/proto.h @@ -1689,26 +1689,32 @@ PERL_CALLCONV I32 Perl_is_lvalue_sub(pTHX) __attribute__warn_unused_result__; PERL_CALLCONV bool Perl_is_uni_alnum(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_alnum_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_alnumc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_alnumc_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_alpha(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_alpha_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; @@ -1743,22 +1749,27 @@ PERL_CALLCONV bool Perl_is_uni_cntrl_lc(pTHX_ UV c) __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_digit(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_digit_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_graph(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_graph_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_idfirst(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; @@ -1768,26 +1779,32 @@ PERL_CALLCONV bool Perl_is_uni_idfirst_lc(pTHX_ UV c) __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_lower(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_lower_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_print(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_print_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_punct(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_punct_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; @@ -1802,10 +1819,12 @@ PERL_CALLCONV bool Perl_is_uni_space_lc(pTHX_ UV c) __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_upper(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; PERL_CALLCONV bool Perl_is_uni_upper_lc(pTHX_ UV c) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__pure__; @@ -1820,18 +1839,21 @@ PERL_CALLCONV bool Perl_is_uni_xdigit_lc(pTHX_ UV c) __attribute__pure__; PERL_CALLCONV bool Perl_is_utf8_alnum(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_ALNUM \ assert(p) PERL_CALLCONV bool Perl_is_utf8_alnumc(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_ALNUMC \ assert(p) PERL_CALLCONV bool Perl_is_utf8_alpha(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_ALPHA \ @@ -1871,12 +1893,14 @@ PERL_CALLCONV bool Perl_is_utf8_cntrl(pTHX_ const U8 *p) assert(p) PERL_CALLCONV bool Perl_is_utf8_digit(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_DIGIT \ assert(p) PERL_CALLCONV bool Perl_is_utf8_graph(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_GRAPH \ @@ -1897,12 +1921,14 @@ PERL_CALLCONV bool Perl_is_utf8_idfirst(pTHX_ const U8 *p) assert(p) PERL_CALLCONV bool Perl_is_utf8_lower(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_LOWER \ assert(p) PERL_CALLCONV bool Perl_is_utf8_mark(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_MARK \ @@ -1930,12 +1956,14 @@ PERL_CALLCONV bool Perl_is_utf8_posix_digit(pTHX_ const U8 *p) assert(p) PERL_CALLCONV bool Perl_is_utf8_print(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_PRINT \ assert(p) PERL_CALLCONV bool Perl_is_utf8_punct(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_PUNCT \ @@ -1964,6 +1992,7 @@ PERL_CALLCONV bool Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 assert(s) PERL_CALLCONV bool Perl_is_utf8_upper(pTHX_ const U8 *p) + __attribute__deprecated__ __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_1); #define PERL_ARGS_ASSERT_IS_UTF8_UPPER \ -- 2.7.4