diff options
author | Paul Marquess <paul.marquess@btinternet.com> | 1998-07-29 10:28:45 +0100 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-09 11:31:53 +0000 |
commit | 599cee73f2261c5e09cde7ceba3f9a896989e117 (patch) | |
tree | ca10c96d845fe755d35da930b1935926856e99b9 /regcomp.c | |
parent | 33938b7370f825af073cea6d9fadf7e82857ec9c (diff) | |
download | perl-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.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -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 ] */ } } |