autoconf-patches
[Top][All Lists]
Advanced

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

Re: _XOPEN_SOURCE=500 breaks at least OSF1 V5.0 [Re: largefiles


From: Alexandre Oliva
Subject: Re: _XOPEN_SOURCE=500 breaks at least OSF1 V5.0 [Re: largefiles
Date: 16 Nov 2000 01:47:23 -0200
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

On Nov 16, 2000, Paul Eggert <address@hidden> wrote:

>> From: Alexandre Oliva <address@hidden>
>> Date: 16 Nov 2000 01:14:50 -0200

>> > int a[(off_t) 9223372036854775807 == 9223372036854775807 ? 1 : -1];
>> 
>> I have a feeling this test must, somehow, be wrong.  If the intent is
>> to test whether off_t is at least 64-bits wide, I think it won't do it
>> on platforms that don't have a wide-enough integer type.

> That test should be OK, on any compiler that conforms to the C
> standard, as the standard requires a diagnostic when no integer type
> is wide enough to represent that constant.

I fear buggy compilers that may just discard the higher order bits,
which would cause the test to pass even though off_t isn't 64-bits
wide.

> I've been using that code for several months and haven't run into
> any compiler where the test doesn't give the right answer.  So I
> wouldn't worry about the issue unless we encounter a compiler that
> elicits the wrong answer.

Ok.  I just found it odd to find this kind of literal constant in an
autoconf test :-) Remember that it may serve of example for other
macro writers who may end up thinking this kind of test is always a
good thing.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  address@hidden, redhat.com}
CS PhD student at IC-Unicamp        address@hidden, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



reply via email to

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