This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Silence some MS VC warnings
authorKarl Williamson <khw@cpan.org>
Fri, 12 Apr 2019 19:14:21 +0000 (13:14 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 12 Apr 2019 20:02:24 +0000 (14:02 -0600)
These are bogus warnings.

regcomp.c

index c5ec281..4583236 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -14648,8 +14648,10 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
           loopdone:   /* Jumped to when encounters something that shouldn't be
                          in the node */
 
-            /* Free up any over-allocated space */
-            change_engine_size(pRExC_state, - (initial_size - STR_SZ(len)));
+            /* Free up any over-allocated space; cast is to silence bogus
+             * warning in MS VC */
+            change_engine_size(pRExC_state,
+                                - (Ptrdiff_t) (initial_size - STR_SZ(len)));
 
             /* I (khw) don't know if you can get here with zero length, but the
              * old code handled this situation by creating a zero-length EXACT