bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uchar tests: avoid compilation error with HP cc


From: Bruno Haible
Subject: uchar tests: avoid compilation error with HP cc
Date: Sat, 04 Jan 2020 02:48:45 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-170-generic; KDE/5.18.0; x86_64; ; )

On HP-UX 11.31/hppa, I'm seeing this compilation error:

cc: "../../gltests/test-uchar.c", line 33: error 1511: Bit-field size must be a 
constant.
cc: "../../gltests/test-uchar.c", line 33: error 1613: Zero-sized struct.
cc: "../../gltests/test-uchar.c", line 33: warning 504: The sizeof operator 
applied to a zero-sized object.

The char32_t is correctly defined. It looks like the compiler has a
problem with casted values in constants.


2020-01-03  Bruno Haible  <address@hidden>

        uchar tests: Avoid compilation error with HP cc.
        * tests/test-uchar.c: Disable a test when HP cc is in use.

diff --git a/tests/test-uchar.c b/tests/test-uchar.c
index c2de59d..020d82d 100644
--- a/tests/test-uchar.c
+++ b/tests/test-uchar.c
@@ -30,7 +30,9 @@ char32_t d = 'y';
 
 /* Check that char16_t and char32_t are unsigned types.  */
 verify ((char16_t)(-1) >= 0);
+#if !defined __HP_cc
 verify ((char32_t)(-1) >= 0);
+#endif
 
 /* Check that char32_t is at least 31 bits wide.  */
 verify ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]