]> Savannah Git Hosting - gnulib.git/commitdiff
totalorder*: Avoid compilation error by IBM XL C compiler.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jun 2024 17:31:46 +0000 (19:31 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 6 Jun 2024 22:42:28 +0000 (00:42 +0200)
* tests/test-totalorder.h (main) [__IBMC__]: Skip the test.

ChangeLog
tests/test-totalorder.h

index 201256e29ad7cdab300e3901f2f50d169881e1ba..91304c521159c2a193e32b899a69320489a93de7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-06-02  Bruno Haible  <bruno@clisp.org>
+
+       totalorder*: Avoid compilation error by IBM XL C compiler.
+       * tests/test-totalorder.h (main) [__IBMC__]: Skip the test.
+
 2024-06-02  Bruno Haible  <bruno@clisp.org>
 
        isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
index c82d11295673fe9ea3a4b8014d9d9c4f49ba14ee..47fd78362a18cce313c2cc7a5ab56540d8c7bde1 100644 (file)
 
 #include <stdio.h>
 
-#include "infinity.h"
-#include "macros.h"
-#include "minus-zero.h"
-#include "signed-nan.h"
-#include "signed-snan.h"
+/* Specification.  */
+#include <math.h>
+
+#if defined __IBMC__
+/* The IBM XL C compiler cannot compile the initializer of x[] below.  */
+
+# include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: broken C compiler\n", stderr);
+  return 77;
+}
+
+#else
+
+# include "infinity.h"
+# include "macros.h"
+# include "minus-zero.h"
+# include "signed-nan.h"
+# include "signed-snan.h"
 
 int
 main ()
@@ -28,9 +45,9 @@ main ()
   TOTALORDER_TYPE x[] =
     {
       { TOTALORDER_NEGATIVE_NAN () },
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_NEGATIVE_SNAN (),
-#endif
+# endif
       { -TOTALORDER_INF () },
       { -1e37 },
       { -1 },
@@ -41,9 +58,9 @@ main ()
       { 1 },
       { 1e37 },
       { TOTALORDER_INF () },
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_POSITIVE_SNAN (),
-#endif
+# endif
       { TOTALORDER_POSITIVE_NAN () }
     };
   int n = SIZEOF (x);
@@ -59,3 +76,5 @@ main ()
 
   return result;
 }
+
+#endif