]> sourceware.org Git - glibc.git/commitdiff
Fix LONG_WIDTH, ULONG_WIDTH include ordering issue.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 4 Oct 2016 16:17:59 +0000 (16:17 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 4 Oct 2016 16:17:59 +0000 (16:17 +0000)
As described in
<https://sourceware.org/ml/libc-alpha/2016-10/msg00047.html>, there is
an include ordering issue with the integer width macros in glibc's
<limits.h>, where definitions conditional on LONG_MAX do not work as
intended because when the headers are installed, this part of glibc's
<limits.h> is processed before the part of GCC's <limits.h> that will
define LONG_MAX.  This patch changes the definitions just to use
__WORDSIZE for the expansion of LONG_WIDTH and ULONG_WIDTH rather than
making those definitions conditional on LONG_MAX.

Tested for x86_64 and x86.

* include/limits.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH):
Define to __WORDSIZE, not conditional on [LONG_MAX ==
0x7fffffffL].
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.

ChangeLog
include/limits.h

index 9ea007a669635a52ed076a71f1aabadf335270ab..7c2139b516abd69edcd8a7610688427784e1eeb4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-04  Joseph Myers  <joseph@codesourcery.com>
+
+       * include/limits.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (LONG_WIDTH):
+       Define to __WORDSIZE, not conditional on [LONG_MAX ==
+       0x7fffffffL].
+       [__GLIBC_USE (IEC_60559_BFP_EXT)] (ULONG_WIDTH): Likewise.
+
 2016-10-04  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
        * sysdeps/powerpc/sys/platform/ppc.h (__ppc_get_timebase): Replace
index 93cac49e55f84a9d577d8b7f0187d0c57c131be1..dd601d5793a1f9bf35ddc57c8c68fe715a6a31ad 100644 (file)
 # ifndef UINT_WIDTH
 #  define UINT_WIDTH 32
 # endif
-# if LONG_MAX == 0x7fffffffL
-#  ifndef LONG_WIDTH
-#   define LONG_WIDTH 32
-#  endif
-#  ifndef ULONG_WIDTH
-#   define ULONG_WIDTH 32
-#  endif
-# else
-#  ifndef LONG_WIDTH
-#   define LONG_WIDTH 64
-#  endif
-#  ifndef ULONG_WIDTH
-#   define ULONG_WIDTH 64
-#  endif
+# ifndef LONG_WIDTH
+#  define LONG_WIDTH __WORDSIZE
+# endif
+# ifndef ULONG_WIDTH
+#  define ULONG_WIDTH __WORDSIZE
 # endif
 # ifndef LLONG_WIDTH
 #  define LLONG_WIDTH 64
This page took 0.179278 seconds and 5 git commands to generate.