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

sv.c

diff --git a/sv.c b/sv.c
index b6d9123..7aa35ab 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -2903,7 +2903,8 @@ S_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const pe
        uv = iv;
        sign = 0;
     } else {
-        uv = -(UV)iv;
+        /* Using 0- here to silence bogus warning from MS VC */
+        uv = (UV) (0 - (UV) iv);
        sign = 1;
     }
 
@@ -12651,7 +12652,8 @@ Perl_sv_vcatpvfn_flags(pTHX_ SV *const sv, const char *const pat, const STRLEN p
                             esignbuf[esignlen++] = plus;
                     }
                     else {
-                        uv = -(UV)iv;
+                        /* Using 0- here to silence bogus warning from MS VC */
+                        uv = (UV) (0 - (UV) iv);
                         esignbuf[esignlen++] = '-';
                     }
                 }