]> 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>
Sun, 2 Jun 2024 17:31:46 +0000 (19:31 +0200)
* tests/test-totalorder.h (main) [__IBMC__]: Skip the test.
* tests/test-totalordermag.h (main) [__IBMC__]: Likewise.

ChangeLog
tests/test-totalorder.h
tests/test-totalordermag.h

index d0e33548ce467e5b3b5783d932ee766ca9e83a51..d3c656a0d14235075186f8bf6718673f4161714f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+       * tests/test-totalordermag.h (main) [__IBMC__]: Likewise.
+
 2024-06-02  Bruno Haible  <bruno@clisp.org>
 
        isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc.
index fd437160bf9955b54d26483e625505278e1050b0..ef8c6b121d3a49d310bca5239cc60f5d1314d7c4 100644 (file)
 
 #include <stdio.h>
 
+/* Specification.  */
 #include <math.h>
-#include "infinity.h"
-#include "macros.h"
-#include "minus-zero.h"
-#include "signed-nan.h"
-#include "signed-snan.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"
 
 static TOTALORDER_TYPE
 positive_NaN_with_payload (int payload)
@@ -47,9 +63,9 @@ main ()
     {
       negative_NaN_with_payload (1729),
       negative_NaN_with_payload (641),
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_NEGATIVE_SNAN (),
-#endif
+# endif
       { -TOTALORDER_INF () },
       { -1e37 },
       { -1 },
@@ -60,9 +76,9 @@ main ()
       { 1 },
       { 1e37 },
       { TOTALORDER_INF () },
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_POSITIVE_SNAN (),
-#endif
+# endif
       positive_NaN_with_payload (641),
       positive_NaN_with_payload (1729)
     };
@@ -78,3 +94,5 @@ main ()
 
   return test_exit_status;
 }
+
+#endif
index 11990cda3d81f5f219babe3a2211cca2853d58ab..94f929f39ee684b3da0e01208b49496d9eed3253 100644 (file)
 
 #include <stdio.h>
 
+/* Specification.  */
 #include <math.h>
-#include "infinity.h"
-#include "macros.h"
-#include "minus-zero.h"
-#include "signed-nan.h"
-#include "signed-snan.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"
 
 static TOTALORDER_TYPE
 positive_NaN_with_payload (int payload)
@@ -47,9 +63,9 @@ main ()
     {
       negative_NaN_with_payload (1729),
       negative_NaN_with_payload (641),
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_NEGATIVE_SNAN (),
-#endif
+# endif
       { -TOTALORDER_INF () },
       { -1e37 },
       { -1 },
@@ -60,9 +76,9 @@ main ()
       { 1 },
       { 1e37 },
       { TOTALORDER_INF () },
-#if TOTALORDER_HAVE_SNAN
+# if TOTALORDER_HAVE_SNAN
       TOTALORDER_POSITIVE_SNAN (),
-#endif
+# endif
       positive_NaN_with_payload (641),
       positive_NaN_with_payload (1729)
     };
@@ -79,3 +95,5 @@ main ()
 
   return test_exit_status;
 }
+
+#endif