summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>2001-06-02 23:53:33 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-03 17:36:40 +0000
commitf9373011490ecee2b16f3addfa5ad001d485d5f9 (patch)
treeba8418026c3f486b12b439dbe3b6af6fb1c16d45 /regcomp.c
parent53e56e0a46451584819aaf58b0d3aee8f2ed60e3 (diff)
downloadperl-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.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 6f807aa02d..32414445d9 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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;