summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorPaul Marquess <paul.marquess@btinternet.com>1998-07-29 10:28:45 +0100
committerGurusamy Sarathy <gsar@cpan.org>1998-08-09 11:31:53 +0000
commit599cee73f2261c5e09cde7ceba3f9a896989e117 (patch)
treeca10c96d845fe755d35da930b1935926856e99b9 /regcomp.c
parent33938b7370f825af073cea6d9fadf7e82857ec9c (diff)
downloadperl-599cee73f2261c5e09cde7ceba3f9a896989e117.tar.gz
lexical warnings; tweaks to places that didn't apply correctly
Message-Id: <9807290828.AA26286@claudius.bfsec.bt.co.uk> Subject: lexical warnings patch for 5.005_50 p4raw-id: //depot/perl@1773
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/regcomp.c b/regcomp.c
index 3c047b6fdf..710d9361f3 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -490,10 +490,10 @@ study_chunk(regnode **scanp, I32 *deltap, regnode *last, scan_data_t *data, U32
? (flags & ~SCF_DO_SUBSTR) : flags);
if (!scan) /* It was not CURLYX, but CURLY. */
scan = next;
- if (PL_dowarn && (minnext + deltanext == 0)
+ if (ckWARN(WARN_UNSAFE) && (minnext + deltanext == 0)
&& !(data->flags & (SF_HAS_PAR|SF_IN_PAR))
&& maxcount <= 10000) /* Complement check for big count */
- warn("Strange *+?{} on zero-length expression");
+ warner(WARN_UNSAFE, "Strange *+?{} on zero-length expression");
min += minnext * mincount;
is_inf |= (maxcount == REG_INFTY && (minnext + deltanext) > 0
|| deltanext == I32_MAX);
@@ -1558,8 +1558,8 @@ regpiece(I32 *flagp)
goto do_curly;
}
nest_check:
- if (PL_dowarn && !SIZE_ONLY && !(flags&HASWIDTH) && max > 10000) {
- warn("%.*s matches null string many times",
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY && !(flags&HASWIDTH) && max > 10000) {
+ warner(WARN_UNSAFE, "%.*s matches null string many times",
PL_regcomp_parse - origparse, origparse);
}
@@ -2115,8 +2115,9 @@ regclass(void)
* (POSIX Extended Character Classes, that is)
* The text between e.g. [: and :] would start
* at posixccs + 1 and stop at regcomp_parse - 2. */
- if (PL_dowarn && !SIZE_ONLY)
- warn("Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY)
+ warner(WARN_UNSAFE,
+ "Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
PL_regcomp_parse++; /* skip over the ending ] */
}
}
@@ -2317,8 +2318,9 @@ regclassutf8(void)
* (POSIX Extended Character Classes, that is)
* The text between e.g. [: and :] would start
* at posixccs + 1 and stop at regcomp_parse - 2. */
- if (PL_dowarn && !SIZE_ONLY)
- warn("Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
+ if (ckWARN(WARN_UNSAFE) && !SIZE_ONLY)
+ warner(WARN_UNSAFE,
+ "Character class syntax [%c %c] is reserved for future extensions", posixccc, posixccc);
PL_regcomp_parse++; /* skip over the ending ] */
}
}