bug-cvs
[Top][All Lists]
Advanced

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

Re: GNULIB stdint_.h vs windows VC6 compiler


From: Paul Eggert
Subject: Re: GNULIB stdint_.h vs windows VC6 compiler
Date: Mon, 21 Aug 2006 09:57:23 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Dennis Jones" <djones@grassvalleysoftware.com> writes:

> #if (LONG_MAX >> 31) >> 31 == 1

It's not a good sign if the compiler can't handle binary operator
precedence; it suggests that other bugs are lurking in the
neighborhood.

I assume that this would need to be done in two places?  There are two
instances of that line in stdint_.h.

Can you please explain the bug more generally?  For example, why is
that change needed, but changes are not needed here?

regex_internal.h:174:#elif BITSET_WORD_MAX >> 31 >> 5 == 1
regex_internal.h:176:#elif BITSET_WORD_MAX >> 31 >> 16 == 1
regex_internal.h:178:#elif BITSET_WORD_MAX >> 31 >> 28 == 1
regex_internal.h:180:#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1
regex_internal.h:182:#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1
regex_internal.h:184:#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1
regex_internal.h:186:#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 
>> 31 >> 31 >> 7 == 1
regex_internal.h:188:#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 
>> 31 >> 31 >> 7 > 1
xtime.h:34:#  if LONG_MAX >> 31 >> 31 == 0


Does the following patch also fix the problem?

--- stdint_.h.~1.31.~   2006-07-27 05:54:05.000000000 -0700
+++ stdint_.h   2006-08-21 09:55:05.000000000 -0700
@@ -123,12 +123,12 @@
 
 #undef int64_t
 #undef uint64_t
-#if LONG_MAX >> 31 >> 31 == 1
-# define int64_t long int
-# define uint64_t unsigned long int
-#elif defined _MSC_VER
+#ifdef _MSC_VER
 # define int64_t __int64
 # define uint64_t unsigned __int64
+#elif LONG_MAX >> 31 >> 31 == 1
+# define int64_t long int
+# define uint64_t unsigned long int
 #elif @HAVE_LONG_LONG_INT@
 # define int64_t long long int
 # define uint64_t unsigned long long int
@@ -423,12 +423,12 @@
 
 #undef INT64_C
 #undef UINT64_C
-#if LONG_MAX >> 31 >> 31 == 1
-# define INT64_C(x) x##L
-# define UINT64_C(x) x##UL
-#elif defined _MSC_VER
+#ifdef _MSC_VER
 # define INT64_C(x) x##i64
 # define UINT64_C(x) x##ui64
+#elif LONG_MAX >> 31 >> 31 == 1
+# define INT64_C(x) x##L
+# define UINT64_C(x) x##UL
 #elif @HAVE_LONG_LONG_INT@
 # define INT64_C(x) x##LL
 # define UINT64_C(x) x##ULL




reply via email to

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