]> Savannah Git Hosting - gnulib.git/commitdiff
inttypes: use more-robust test for int range
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Oct 2019 19:48:54 +0000 (12:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Oct 2019 19:52:18 +0000 (12:52 -0700)
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
lib/inttypes.in.h

index 2c63d42b6f1d43c98f201aa4d1d00919719ea5b8..cd62812712dec562cd65b1f99c8aa190e3e11fd8 100644 (file)
--- 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.
index 31e40c51a6806ddfed1e57535b973814dcfbfc17..49bcbc168f73c7f3b3bdc78228d707daf1f5193e 100644 (file)
 #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.  */