[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
stdbool tests: Avoid compilation error with Sun C on Solaris 10
From: |
Bruno Haible |
Subject: |
stdbool tests: Avoid compilation error with Sun C on Solaris 10 |
Date: |
Sat, 29 Apr 2023 03:20:18 +0200 |
On Solaris 10/SPARC with Sun C 5.8, I get this compilation error:
cc -D_STDC_C99= -xarch=generic64 -O -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\"
-I. -I../../gltests -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I.
-I../../gltests -I.. -I../../gltests/.. -I../gllib -I../../gltests/../gllib
-I/home/haible/prefix-sparc64/include -D_REENTRANT -g -c -o test-stdbool-c99.o
../../gltests/test-stdbool-c99.c
"../../gltests/test-stdbool.c", line 64: zero or negative subscript
"../../gltests/test-stdbool.c", line 100: warning: improper pointer/integer
combination: op "="
cc: acomp failed for ../../gltests/test-stdbool-c99.c
*** Error code 2
This patch avoids the compilation error.
2023-04-28 Bruno Haible <bruno@clisp.org>
stdbool tests: Avoid compilation error with Sun C on Solaris 10.
* tests/test-stdbool.c (WORKING_BOOL): Set to 0 on Sun C.
diff --git a/tests/test-stdbool.c b/tests/test-stdbool.c
index 6ca9535e87..a4ff4d4b53 100644
--- a/tests/test-stdbool.c
+++ b/tests/test-stdbool.c
@@ -48,7 +48,7 @@
least, not for all compilers and compiler options. */
#if ((HAVE_C_BOOL || defined __cplusplus \
|| HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__) \
- && !defined _MSC_VER)
+ && !(defined _MSC_VER || defined __SUNPRO_C))
# define WORKING_BOOL 1
#else
# define WORKING_BOOL 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- stdbool tests: Avoid compilation error with Sun C on Solaris 10,
Bruno Haible <=