Don't warn about imprecision when decrementing IV_MIN.
authorNicholas Clark <nick@ccl4.org>
Thu, 24 Jan 2008 21:11:11 +0000 (21:11 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 24 Jan 2008 21:11:11 +0000 (21:11 +0000)
Based on a patch by Jerry D. Hedden, but only instead only disable
warnings for the specific operations that we know will warn.

p4raw-id: //depot/perl@33065

t/op/64bitint.t

index e8314fa..399030a 100644 (file)
@@ -172,13 +172,19 @@ if ($^O ne 'unicos') {
     print "ok 28\n";
 
     $a = -9223372036854775808;
-    $c = $a--;
+    {
+       no warnings 'imprecision';
+       $c = $a--;
+    }
     print "not "
        unless $a == -9223372036854775809 && $c == -9223372036854775808;
     print "ok 29\n";
 
     $a = -9223372036854775808;
-    $c = --$a;
+    {
+       no warnings 'imprecision';
+       $c = --$a;
+    }
     print "not "
        unless $a == -9223372036854775809 && $c == $a;
     print "ok 30\n";
@@ -191,14 +197,20 @@ if ($^O ne 'unicos') {
     
     $a = 9223372036854775808;
     $a = -$a;
-    $c = $a--;
+    {
+       no warnings 'imprecision';
+       $c = $a--;
+    }
     print "not "
        unless $a == -9223372036854775809 && $c == -9223372036854775808;
     print "ok 32\n";
     
     $a = 9223372036854775808;
     $a = -$a;
-    $c = --$a;
+    {
+       no warnings 'imprecision';
+       $c = --$a;
+    }
     print "not "
        unless $a == -9223372036854775809 && $c == $a;
     print "ok 33\n";
@@ -212,14 +224,20 @@ if ($^O ne 'unicos') {
 
     $a = 9223372036854775808;
     $b = -$a;
-    $c = $b--;
+    {
+       no warnings 'imprecision';
+       $c = $b--;
+    }
     print "not "
        unless $b == -$a-1 && $c == -$a;
     print "ok 35\n";
 
     $a = 9223372036854775808;
     $b = -$a;
-    $c = --$b;
+    {
+       no warnings 'imprecision';
+       $c = --$b;
+    }
     print "not "
        unless $b == -$a-1 && $c == $b;
     print "ok 36\n";