On 10/15/19 4:07 AM, Dagobert Michelsen wrote:
It seems to be a compiler issue: Studio 12.6: works Studio 12.5: works Studio 12.4: works Studio 12.3: broken with the error above Studio 12.2: broken with the error above Studio 12.1: broken with the error above Studio 12: broken with the error above
That explains why I didn't see the problem; I was using 12.6.
Studio 12.3 is already quite old and I am not sure if it worth further investigation, what do you think?
Might as well fix it now that you brought it up. Studio 12.3 is supported by Oracle until December of this year.[1] Older Studio releases are no longer supported, so I wouldn't bother using them to check GNU code - why should GNU worry about a proprietary platform if even the proprietor doesn't?
The bug has to do with the confusing reinclusion between stdint.h, inttypes.h, etc. As you say, this is low priority, so rather than figure out the actual bug I installed the attached workaround, which should be safe on all platforms.
[1] Oracle and Sun System Software and Operating Systems – October, 2019. https://www.oracle.com/us/assets/lifetime-support-hardware-301321.pdf
>From dc26e6a796eb86ba8896e03ff056037c0fb017fc Mon Sep 17 00:00:00 2001 From: Paul Eggert <[email protected]> Date: Tue, 15 Oct 2019 12:48:54 -0700 Subject: [PATCH] inttypes: use more-robust test for int range This fixes Bison 3.4.2 when built with Oracle Solaris Studio 12.3. Problem reported by Dagobert Michelsen in: https://lists.gnu.org/r/bug-gnulib/2019-10/msg00042.html * lib/inttypes.in.h: Rely only on limits.h when checking int range. --- ChangeLog | 9 +++++++++ lib/inttypes.in.h | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c63d42b6..cd6281271 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2019-10-15 Paul Eggert <[email protected]> + + inttypes: use more-robust test for int range + This fixes Bison 3.4.2 when built with Oracle Solaris Studio 12.3. + Problem reported by Dagobert Michelsen in: + https://lists.gnu.org/r/bug-gnulib/2019-10/msg00042.html + * lib/inttypes.in.h: Rely only on limits.h when checking + int range. + 2019-10-15 Bruno Haible <[email protected]> libtextstyle-optional: Sync with current not-yet-released libtextstyle. diff --git a/lib/inttypes.in.h b/lib/inttypes.in.h index 31e40c51a..49bcbc168 100644 --- a/lib/inttypes.in.h +++ b/lib/inttypes.in.h @@ -49,15 +49,15 @@ #ifndef __GLIBC__ # include <stdint.h> #endif -/* Get CHAR_BIT. */ +/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */ #include <limits.h> /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */ #if defined _WIN32 && ! defined __CYGWIN__ # include <stdio.h> #endif -#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX) -# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <[email protected]>." +#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1) +# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <[email protected]>." #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ -- 2.21.0
