From: Nicholas Clark Date: Tue, 13 Oct 2009 06:12:04 +0000 (+0100) Subject: Use deprecate() in place of deprecate_old(), and remove S_deprecate_old(). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8ab8f082f7fb7802421b5fc8ff6576774161e703;p=p5sagit%2Fp5-mst-13.2.git Use deprecate() in place of deprecate_old(), and remove S_deprecate_old(). --- diff --git a/embed.fnc b/embed.fnc index e51d89a..7e4ce51 100644 --- a/embed.fnc +++ b/embed.fnc @@ -215,9 +215,6 @@ Anp |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ pM |void |delete_eval_scope : Used in various files p |void |deprecate |NN const char *const s -#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) -s |void |deprecate_old |NN const char *const s -#endif Afp |OP* |die |NULLOK const char* pat|... #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) s |OP* |vdie |NULLOK const char* pat|NULLOK va_list* args diff --git a/embed.h b/embed.h index b987bd1..59e8174 100644 --- a/embed.h +++ b/embed.h @@ -152,11 +152,6 @@ #define delete_eval_scope Perl_delete_eval_scope #define deprecate Perl_deprecate #endif -#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) -#ifdef PERL_CORE -#define deprecate_old S_deprecate_old -#endif -#endif #define die Perl_die #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE @@ -2495,11 +2490,6 @@ #define delete_eval_scope() Perl_delete_eval_scope(aTHX) #define deprecate(a) Perl_deprecate(aTHX_ a) #endif -#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) -#ifdef PERL_CORE -#define deprecate_old(a) S_deprecate_old(aTHX_ a) -#endif -#endif #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE #define vdie(a,b) S_vdie(aTHX_ a,b) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index fb00adc..ab9a947 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -4685,12 +4685,12 @@ is deprecated. See L. =item Use of bare << to mean <<"" is deprecated -(D deprecated, W syntax) You are now encouraged to use the explicitly quoted +(D deprecated) You are now encouraged to use the explicitly quoted form if you wish to use an empty line as the terminator of the here-document. =item Use of comma-less variable list is deprecated -(D deprecated, W syntax) The values you give to a format should be +(D deprecated) The values you give to a format should be separated by commas, not just aligned on a line. =item Use of chdir('') or chdir(undef) as chdir() deprecated diff --git a/proto.h b/proto.h index 05b3812..c99a25a 100644 --- a/proto.h +++ b/proto.h @@ -521,13 +521,6 @@ PERL_CALLCONV void Perl_deprecate(pTHX_ const char *const s) #define PERL_ARGS_ASSERT_DEPRECATE \ assert(s) -#if defined(PERL_IN_TOKE_C) || defined(PERL_DECL_PROT) -STATIC void S_deprecate_old(pTHX_ const char *const s) - __attribute__nonnull__(pTHX_1); -#define PERL_ARGS_ASSERT_DEPRECATE_OLD \ - assert(s) - -#endif PERL_CALLCONV OP* Perl_die(pTHX_ const char* pat, ...) __attribute__format__null_ok__(__printf__,pTHX_1,pTHX_2); diff --git a/toke.c b/toke.c index 4e711ab..03cf6fd 100644 --- a/toke.c +++ b/toke.c @@ -596,23 +596,6 @@ Perl_deprecate(pTHX_ const char *const s) Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of %s is deprecated", s); } -static void -S_deprecate_old(pTHX_ const char *const s) -{ - /* This function should NOT be called for any new deprecated warnings */ - /* Use Perl_deprecate instead */ - /* */ - /* It is here to maintain backward compatibility with the pre-5.8 */ - /* warnings category hierarchy. The "deprecated" category used to */ - /* live under the "syntax" category. It is now a top-level category */ - /* in its own right. */ - - PERL_ARGS_ASSERT_DEPRECATE_OLD; - - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), - "Use of %s is deprecated", s); -} - /* * experimental text filters for win32 carriage-returns, utf16-to-utf8 and * utf16-to-utf8-reversed. @@ -4878,7 +4861,7 @@ Perl_yylex(pTHX) if (PL_expect == XOPERATOR) { if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) { PL_expect = XTERM; - deprecate_old(commaless_variable_list); + deprecate(commaless_variable_list); return REPORT(','); /* grandfather non-comma-format format */ } } @@ -5136,7 +5119,7 @@ Perl_yylex(pTHX) if (PL_expect == XOPERATOR) { if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) { PL_expect = XTERM; - deprecate_old(commaless_variable_list); + deprecate(commaless_variable_list); return REPORT(','); /* grandfather non-comma-format format */ } else @@ -5153,7 +5136,7 @@ Perl_yylex(pTHX) if (PL_expect == XOPERATOR) { if (PL_lex_formbrack && PL_lex_brackets == PL_lex_formbrack) { PL_expect = XTERM; - deprecate_old(commaless_variable_list); + deprecate(commaless_variable_list); return REPORT(','); /* grandfather non-comma-format format */ } else @@ -11292,7 +11275,7 @@ S_scan_heredoc(pTHX_ register char *s) else term = '"'; if (!isALNUM_lazy_if(s,UTF)) - deprecate_old("bare << to mean <<\"\""); + deprecate("bare << to mean <<\"\""); for (; isALNUM_lazy_if(s,UTF); s++) { if (d < e) *d++ = *s;