+2008-10-17 Bruno Haible <bruno@clisp.org>
+
+ * m4/signbit.m4 (gl_SIGNBIT_TEST_PROGRAM): On platforms other than
+ HP-UX and IRIX, use -0.0L.
+ * tests/test-ceill.c (minus_zero): Likewise.
+ * tests/test-floorl.c (minus_zero): Likewise.
+ * tests/test-frexpl.c (minus_zero): Likewise.
+ * tests/test-isnan.c (minus_zerol): Likewise.
+ * tests/test-isnanl.h (minus_zero): Likewise.
+ * tests/test-ldexpl.c (minus_zero): Likewise.
+ * tests/test-roundl.c (minus_zero): Likewise.
+ * tests/test-signbit.c (minus_zerol): Likewise.
+ * tests/test-snprintf-posix.h (minus_zerol): Likewise.
+ * tests/test-sprintf-posix.h (minus_zerol): Likewise.
+ * tests/test-truncl.c (minus_zero): Likewise.
+ * tests/test-vasnprintf-posix.c (minus_zerol): Likewise.
+ * tests/test-vasprintf-posix.c (minus_zerol): Likewise.
+ Reported by Markus Armbruster <armbru@redhat.com> via Jim Meyering
+ and by Nelson H. F. Beebe <beebe@math.utah.edu> via Eric Blake.
+
2008-10-17 Bruno Haible <bruno@clisp.org>
Avoid gcc warnings because of #pragma GCC system_header on older gcc.
double p0d = 0.0;
double m0d = -p0d;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use another constant expression instead. */
+ So we use another constant expression instead.
+ But that expression does not work on other platforms, such as when
+ cross-compiling to PowerPC on MacOS X 10.5. */
long double p0l = 0.0L;
-#ifdef __hpux
+#if defined __hpux || defined __sgi
long double m0l = -LDBL_MIN * LDBL_MIN;
#else
long double m0l = -p0l;
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
#endif
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
static long double
my_ldexp (long double x, int d)
double zerod = 0.0;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
static void
test_float (void)
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
So we use -zerod instead. */
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
static void
test_signbitf ()
double zerod = 0.0;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
double zerod = 0.0;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
while (0)
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zero instead. */
+ So we use minus_zero instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zero = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zero = -0.0L;
+#endif
int
main ()
double zerod = 0.0;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */
double zerod = 0.0;
/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
- So we use minus_zerol instead. */
+ So we use minus_zerol instead.
+ Note that the expression -LDBL_MIN * LDBL_MIN does not work on other
+ platforms, such as when cross-compiling to PowerPC on MacOS X 10.5. */
+#if defined __hpux || defined __sgi
long double minus_zerol = -LDBL_MIN * LDBL_MIN;
+#else
+long double minus_zerol = -0.0L;
+#endif
/* Representation of an 80-bit 'long double' as an initializer for a sequence
of 'unsigned int' words. */