This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: glibc 2.1.93


> The problems seems to be that <bits/xopen_lim.h> has:
> /* Number of bits in a word of type `int'.  */
> #if INT_MAX == 32767
> # define WORD_BIT       16
> #else
> # if INT_MAX == 2147483647
> #  define WORD_BIT      32
> # else
> /* Safe assumption.  */
> #  define WORD_BIT      64
> # endif
> #endif
> 
> but INT_MAX is not defined yet :-(.

Thanks, that is indeed the cause. I moved the definition of INT_MAX to
the top of <limits.h>, so it works now.

If anybody cares where the correct value of LONG_BIT matters: In
Python, detection of overflow in integer multiplication shifts by
LONG_BIT/2. Since LONG_BIT was 64, the shift was a no-op, and it
concluded that 1*1 causes an integer overflow.

Therefore, I'm also concerned about using INT_MAX when #defining
*LONG_BIT*. On systems with 32-bit int and 64-bit long, wouldn't it
conclude that LONG_BIT is 32? Wouldn't that be incorrect?

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]