bug-gnulib
[Top][All Lists]
Advanced

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

WCHAR_WIDTH with HP-UX cc


From: Bruno Haible
Subject: WCHAR_WIDTH with HP-UX cc
Date: Wed, 15 Mar 2017 22:04:14 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-66-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

With cc on HP-UX 11.31, test-stdint.c fails to compile:

cc -DHAVE_CONFIG_H -I. -I..  -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  
-I. -I.  -I.. -I./..  -I../gllib -I./../gllib    -g -c -o test-stdint.o 
test-stdint.c
cc: "test-stdint.c", line 414: error 1511: Bit-field size must be a constant.
cc: "test-stdint.c", line 414: error 1613: Zero-sized struct.
cc: "test-stdint.c", line 414: warning 504: The sizeof operator applied to a 
zero-sized object.
cc: "test-stdint.c", line 416: error 1511: Bit-field size must be a constant.
cc: "test-stdint.c", line 416: error 1613: Zero-sized struct.
cc: "test-stdint.c", line 416: warning 504: The sizeof operator applied to a 
zero-sized object.
cc: "test-stdint.c", line 419: error 1511: Bit-field size must be a constant.
cc: "test-stdint.c", line 419: error 1613: Zero-sized struct.
cc: "test-stdint.c", line 419: warning 504: The sizeof operator applied to a 
zero-sized object.
*** Error exit code 1

The problematic line is:
  verify_width (WCHAR_WIDTH, WCHAR_MIN, WCHAR_MAX);

In order to understand which of the three macros introduces the problem, I added
three lines:

  int aa = WCHAR_WIDTH;
  int ab = WCHAR_MIN;
  int ac = WCHAR_MAX;

The initializations of 'ab' and 'ac' were OK, but the first line gives an error:

cc: "test-stdint.c", line 26: error 1521: Incorrect initialization.

Since WCHAR_WIDTH expands to a sequence of ca. 12890 characters, apparently
coming from
gllib/stdint.h:# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
I would suggest to simplify _GL_INTEGER_WIDTH by assuming that its value
MUST be one of 8, 16, 32, 64, 128. Gnulib does not attempt portability to
machines with 36-bit words or 3-bit integer types.

The same error appears also at
verify_width (WINT_WIDTH, WINT_MIN, WINT_MAX);
and
verify_width (SIG_ATOMIC_WIDTH, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX);

Bruno




reply via email to

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