In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/a4df5da1fe962395b9ad9ab6a0922d022fdb809c?hp=f10f4c183a00badad8742a2a435477ad8cd8c6ee>
- Log ----------------------------------------------------------------- commit a4df5da1fe962395b9ad9ab6a0922d022fdb809c Author: Nicholas Clark <[email protected]> Date: Tue Oct 13 07:37:35 2009 +0100 Remove category 'syntax' from 5 warnings that should just be in 'deprecated'. None were documented as also being in 'syntax'. Effectively, this completes the reorganisation of commits 12bcd1a617c74d6e and 9014280dc8264580. See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2009-10/msg00601.html and http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-03/msg00850.html M gv.c M op.c commit 8ab8f082f7fb7802421b5fc8ff6576774161e703 Author: Nicholas Clark <[email protected]> Date: Tue Oct 13 07:12:04 2009 +0100 Use deprecate() in place of deprecate_old(), and remove S_deprecate_old(). M embed.fnc M embed.h M pod/perldiag.pod M proto.h M toke.c ----------------------------------------------------------------------- Summary of changes: embed.fnc | 3 --- embed.h | 10 ---------- gv.c | 2 +- op.c | 12 ++++++------ pod/perldiag.pod | 4 ++-- proto.h | 7 ------- toke.c | 25 ++++--------------------- 7 files changed, 13 insertions(+), 50 deletions(-) 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/gv.c b/gv.c index 38f7208..e967f90 100644 --- a/gv.c +++ b/gv.c @@ -729,7 +729,7 @@ Perl_gv_autoload4(pTHX_ HV *stash, const char *name, STRLEN len, I32 method) */ if (!method && (GvCVGEN(gv) || GvSTASH(gv) != stash) ) - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated", packname, (int)len, name); diff --git a/op.c b/op.c index 4611dca..bb9a292 100644 --- a/op.c +++ b/op.c @@ -6845,7 +6845,7 @@ Perl_ck_fun(pTHX_ OP *o) { OP * const newop = newAVREF(newGVOP(OP_GV, 0, gv_fetchsv(((SVOP*)kid)->op_sv, GV_ADD, SVt_PVAV) )); - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Array @%"SVf" missing the @ in argument %"IVdf" of %s()", SVfARG(((SVOP*)kid)->op_sv), (IV)numargs, PL_op_desc[type]); #ifdef PERL_MAD @@ -6867,7 +6867,7 @@ Perl_ck_fun(pTHX_ OP *o) { OP * const newop = newHVREF(newGVOP(OP_GV, 0, gv_fetchsv(((SVOP*)kid)->op_sv, GV_ADD, SVt_PVHV) )); - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "Hash %%%"SVf" missing the %% in argument %"IVdf" of %s()", SVfARG(((SVOP*)kid)->op_sv), (IV)numargs, PL_op_desc[type]); #ifdef PERL_MAD @@ -7215,9 +7215,9 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ break; /* Globals via GV can be undef */ case OP_PADAV: case OP_AASSIGN: /* Is this a good idea? */ - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "defined(@array) is deprecated"); - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "\t(Maybe you should just omit the defined()?)\n"); break; case OP_RV2HV: @@ -7227,9 +7227,9 @@ Perl_ck_defined(pTHX_ OP *o) /* 19990527 MJD */ */ break; /* Globals via GV can be undef */ case OP_PADHV: - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "defined(%%hash) is deprecated"); - Perl_ck_warner(aTHX_ packWARN2(WARN_DEPRECATED, WARN_SYNTAX), + Perl_ck_warner(aTHX_ packWARN(WARN_DEPRECATED), "\t(Maybe you should just omit the defined()?)\n"); break; default: 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<perlvar/"$[">. =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; -- Perl5 Master Repository
