fix unused variable warnings in new nextafter/nexttoward code
authorRich Felker <dalias@aerifal.cx>
Sun, 6 May 2012 18:48:20 +0000 (14:48 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 6 May 2012 18:48:20 +0000 (14:48 -0400)
apparently initializing a variable is not "using" it but assigning to
it is "using" it. i don't really like this fix, but it's better than
trying to make a bigger cleanup just before a release, and it should
work fine (tested against nsz's math tests).

src/math/nextafter.c
src/math/nextafterf.c
src/math/nextafterl.c
src/math/nexttoward.c
src/math/nexttowardf.c

index d9e2923..e4bfb02 100644 (file)
@@ -30,7 +30,8 @@ double nextafter(double x, double y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (e == 0) {
-               volatile double z = x*x + ux.value*ux.value;
+               volatile double z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }
index 4727f7b..47775b9 100644 (file)
@@ -29,7 +29,8 @@ float nextafterf(float x, float y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (e == 0) {
-               volatile float z = x*x + ux.value*ux.value;
+               volatile float z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }
index 611ea53..c09d9dd 100644 (file)
@@ -39,7 +39,8 @@ long double nextafterl(long double x, long double y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (ux.bits.exp == 0) {
-               volatile float z = x*x + ux.value*ux.value;
+               volatile float z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }
@@ -77,7 +78,8 @@ long double nextafterl(long double x, long double y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (ux.bits.exp == 0) {
-               volatile float z = x*x + ux.value*ux.value;
+               volatile float z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }
index 741b6b5..43f8fee 100644 (file)
@@ -39,7 +39,8 @@ double nexttoward(double x, long double y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (e == 0) {
-               volatile float z = x*x + ux.value*ux.value;
+               volatile float z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }
index 821f72a..e8e6f67 100644 (file)
@@ -31,7 +31,8 @@ float nexttowardf(float x, long double y)
                return x + x;
        /* raise underflow if ux.value is subnormal or zero */
        if (e == 0) {
-               volatile float z = x*x + ux.value*ux.value;
+               volatile float z;
+               z = x*x + ux.value*ux.value;
        }
        return ux.value;
 }