regmatch(): silence OpenWatcom compiler warnings
authorDavid Mitchell <davem@iabyn.com>
Wed, 21 Nov 2012 17:01:38 +0000 (17:01 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 21 Nov 2012 18:25:54 +0000 (18:25 +0000)
There are two MULTICALL variables which are assigned to in one branch,
but not the other. The values of these variables are never used.
OpenWatcom complains about this, and the easiest way to shut it up may be
to assign null values in the other branch. As bulk88 pointed out, these
assignments should be optimised away anyway.

Based on a patch originally submitted by Reini Urban, but without
removing the PERL_UNUSED_VAR's required for gcc.

See the thread <50A2B8E5.5030401@gknw.net> for more info.

regexec.c

index d0560ce..cf8d82e 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -4862,6 +4862,12 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
                    }
                    last_pushed_cv = newcv;
                }
+               else {
+                    /* these assignments are just to silence compiler
+                     * warnings */
+                   multicall_cop = NULL;
+                   newsp = NULL;
+               }
                last_pad = PL_comppad;
 
                /* the initial nextstate you would normally execute