diff options
author | Paul Marquess <paul.marquess@btinternet.com> | 2001-06-02 23:53:33 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-03 17:36:40 +0000 |
commit | f9373011490ecee2b16f3addfa5ad001d485d5f9 (patch) | |
tree | ba8418026c3f486b12b439dbe3b6af6fb1c16d45 /regcomp.c | |
parent | 53e56e0a46451584819aaf58b0d3aee8f2ed60e3 (diff) | |
download | perl-f9373011490ecee2b16f3addfa5ad001d485d5f9.tar.gz |
RE: [PATCHES] regcomp.c, pod/perldiag.pod, t/op/pat.t
Message-ID: <000601c0ebae$77d10dc0$99dcfea9@bfs.phone.com>
p4raw-id: //depot/perl@10410
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -393,6 +393,14 @@ static scan_data_t zero_scan_data = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, m, (int)offset, RExC_precomp, RExC_precomp + offset); \ } STMT_END \ +#define vWARNdep(loc,m) \ + STMT_START { \ + unsigned offset = strlen(RExC_precomp)-(RExC_end-(loc)); \ + int warn_cat = ckWARN(WARN_REGEXP) ? WARN_REGEXP : WARN_DEPRECATED; \ + Perl_warner(aTHX_ warn_cat, "%s" REPORT_LOCATION,\ + m, (int)offset, RExC_precomp, RExC_precomp + offset); \ + } STMT_END \ + #define vWARN2(loc, m, a1) \ STMT_START { \ @@ -2082,8 +2090,8 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp) *flagp = TRYAGAIN; return NULL; case 'p': /* (?p...) */ - if (SIZE_ONLY) - vWARN(RExC_parse, "(?p{}) is deprecated - use (??{})"); + if (SIZE_ONLY && ckWARN2(WARN_DEPRECATED, WARN_REGEXP)) + vWARNdep(RExC_parse, "(?p{}) is deprecated - use (??{})"); /* FALL THROUGH*/ case '?': /* (??...) */ logical = 1; |