bug-gnulib
[Top][All Lists]
Advanced

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

Re: rethinking #if and 64-bit numbers (inttypes.h on Sun platforms)


From: Bruno Haible
Subject: Re: rethinking #if and 64-bit numbers (inttypes.h on Sun platforms)
Date: Tue, 13 Nov 2007 01:32:42 +0100
User-agent: KMail/1.5.4

Hi Paul,

> The Solaris compiler has a buggy
> preprocessor which misevaluates "#if -9223372036854775807LL < 0", I
> suspect because it treats the constant as being unsigned.

Based on the results from [1] I guess the preprocessor looks for the sign
in bit 31 instead of in bit 63.

> I considered working around the problem by causing 32-bit Solaris
> builds to fall back into a 32-bit-only world.  But that is too
> drastic; it would break large-file support, for example.

Indeed: While 32-bit-only mode is OK for GNU gettext, it is not sufficient
for tar or gzip...

>  In the meantime, code should not expect
>  #if to work with literals wider than 32 bits.  */

Can you document this limitation in doc/headers/stdint.texi please?
Possibly also in autoconf.texi section "Portable C and C++ Programming"?

Bruno

[1] http://lists.gnu.org/archive/html/autoconf-patches/2007-10/msg00210.html





reply via email to

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