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

pp_hot.c

index 7c6b3a8..7d5ffc0 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1526,7 +1526,9 @@ PP(pp_add)
                        auv = aiv;
                        auvok = 1;      /* Now acting as a sign flag.  */
                    } else {
-                       auv = -(UV)aiv;
+                        /* Using 0- here and later to silence bogus warning
+                         * from MS VC */
+                        auv = (UV) (0 - (UV) aiv);
                    }
                }
                a_valid = 1;
@@ -1546,7 +1548,7 @@ PP(pp_add)
                    buv = biv;
                    buvok = 1;
                } else
-                    buv = -(UV)biv;
+                    buv = (UV) (0 - (UV) biv);
            }
            /* ?uvok if value is >= 0. basically, flagged as UV if it's +ve,
               else "IV" now, independent of how it came in.