summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-03-29 15:36:40 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-18 20:26:54 +0100
commitf19a8d855f15f8e08413bb049a7effea4cd44b3c (patch)
treeab23f8ea17accac17f50abb99684b77bfbcaec15 /regcomp.c
parent4b1123b95676547d1127156b465c8067d112936e (diff)
downloadperl-f19a8d855f15f8e08413bb049a7effea4cd44b3c.tar.gz
In S_regpiece(), only declare parse_start if conditional code needs it.
gcc 4.6.0 warns about variables that are set but never read, and unless RE_TRACK_PATTERN_OFFSETS is defined, parse_start is never read. So avoid declaring or setting it if it's not actually going to be used later.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index dcd9856db3..ba59390da2 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -7504,7 +7504,9 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
const char * const origparse = RExC_parse;
I32 min;
I32 max = REG_INFTY;
+#ifdef RE_TRACK_PATTERN_OFFSETS
char *parse_start;
+#endif
const char *maxpos = NULL;
GET_RE_DEBUG_FLAGS_DECL;
@@ -7523,7 +7525,9 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
if (op == '{' && regcurly(RExC_parse)) {
maxpos = NULL;
+#ifdef RE_TRACK_PATTERN_OFFSETS
parse_start = RExC_parse; /* MJD */
+#endif
next = RExC_parse + 1;
while (isDIGIT(*next) || *next == ',') {
if (*next == ',') {
@@ -7619,7 +7623,9 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
vFAIL("Regexp *+ operand could be empty");
#endif
+#ifdef RE_TRACK_PATTERN_OFFSETS
parse_start = RExC_parse;
+#endif
nextchar(pRExC_state);
*flagp = (op != '+') ? (WORST|SPSTART|HASWIDTH) : (WORST|HASWIDTH);