bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Dagobert Michelsen <dam@baltic-online.de>
Cc: bug-gnulib@gnu.org, bug-bison@gnu.org
Subject: Re: Error compiling bison 3.4.2 on Solaris
Date: Tue, 15 Oct 2019 13:04:53 -0700	[thread overview]
Message-ID: <44a8d8f5-92a8-665e-9006-10d0b8692002@cs.ucla.edu> (raw)
In-Reply-To: <D718019B-2D23-495B-A2A6-14364C0FF3B8@baltic-online.de>

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

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

[-- Attachment #2: 0001-inttypes-use-more-robust-test-for-int-range.patch --]
[-- Type: text/x-patch, Size: 2053 bytes --]

From dc26e6a796eb86ba8896e03ff056037c0fb017fc Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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  <eggert@cs.ucla.edu>
+
+	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  <bruno@clisp.org>
 
 	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 <bug-gnulib@gnu.org>."
+#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 <bug-gnulib@gnu.org>."
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
-- 
2.21.0


  reply	other threads:[~2019-10-15 20:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14  8:32 Error compiling bison 3.4.2 on Solaris Dagobert Michelsen
2019-10-15  4:08 ` Paul Eggert
2019-10-15 11:07   ` Dagobert Michelsen
2019-10-15 20:04     ` Paul Eggert [this message]
2019-10-16 13:36       ` Dagobert Michelsen
2019-10-17 19:49         ` Paul Eggert
2019-10-18  4:52           ` Akim Demaille
2019-10-22 12:04           ` Dagobert Michelsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44a8d8f5-92a8-665e-9006-10d0b8692002@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-bison@gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=dam@baltic-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).