From af977b09367c57ca8d841e3b60dced9c4c342e7d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 2 Jun 2024 19:31:46 +0200 Subject: [PATCH] totalorder*: Avoid compilation error by IBM XL C compiler. * tests/test-totalorder.h (main) [__IBMC__]: Skip the test. --- ChangeLog | 5 +++++ tests/test-totalorder.h | 37 ++++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 201256e29a..91304c5211 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2024-06-02 Bruno Haible + + totalorder*: Avoid compilation error by IBM XL C compiler. + * tests/test-totalorder.h (main) [__IBMC__]: Skip the test. + 2024-06-02 Bruno Haible isnanf, isnand, isnanl: Fix link errors on AIX 7.1 with xlc. diff --git a/tests/test-totalorder.h b/tests/test-totalorder.h index c82d112956..47fd78362a 100644 --- a/tests/test-totalorder.h +++ b/tests/test-totalorder.h @@ -16,11 +16,28 @@ #include -#include "infinity.h" -#include "macros.h" -#include "minus-zero.h" -#include "signed-nan.h" -#include "signed-snan.h" +/* Specification. */ +#include + +#if defined __IBMC__ +/* The IBM XL C compiler cannot compile the initializer of x[] below. */ + +# include + +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 -- 2.39.5