gnustep-dev
[Top][All Lists]
Advanced

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

Re: error while compiling base


From: Richard Frith-Macdonald
Subject: Re: error while compiling base
Date: Thu, 18 Feb 2010 05:52:04 +0000

On 17 Feb 2010, at 23:03, David Chisnall wrote:

> On 17 Feb 2010, at 22:44, Richard Frith-Macdonald wrote:
> 
>> No, it's a typo made when converting from using the old, reliable, 
>> LONG_LONG_MAX (basically worked on every platform except perhaps BSD, and 
>> used to be the default but is now the fallback mechanism) to the newer c99 
>> standard (which works on most modern platforms and is now the default, but 
>> used to be the fallback mechanism).
> 
> Ah, fair enough.
> 
>> I know you are a BSD person, but the reality is that GNUstep is GNU software 
>> and uses the GNU compiler (GCC) ... so saying something 'will break anywhere 
>> except GNU platforms' is actually pretty close to saying that it will break 
>> anywhere that GNUstep doesn't run, and sounds perilously like a religious 
>> argument.  
> 
> 
> Not at all.  It's from limits.h, which is provided by libc.  The C standard 
> defines LLONG_MAX.

It does ... but even now, not all systems conform to the current standard ... 
and I think this code dates from before the standard (before my time anyway)!

>  GNU libc and HP-UX libc define LONG_LONG_MAX, but most other libc's that I 
> checked don't.  AIX defines LONGLONG_MAX, others define their own flavour, in 
> addition to the standard LLONG_MAX.  Both the long long type and the 
> LLONG_MAX macro in limits.h were defined at the same time, as part of C99.  

Sure, but the type (and the gnu macro) pre-date the standard.  I expect the 
code originally used LONG_LONG_MAX as the de-facto standard at the time it was 
written.

> GCC, on the other hand, has a built-in __LONG_LONG_MAX__, which is set by the 
> compiler based on the target triple and is used on some libc versions to 
> initialise LLONG_MAX.  I'd have no problems with your using 
> __LONG_LONG_MAX__, since, as far as I know, this works on all existing 
> Objective-C compilers that support a long long data type.

Let's do that then.

> Unless I'm mistaken, GNUstep runs on a lot of non-GNU platforms.  If this 
> isn't the case, maybe someone should delete some of the 11 listed here (not 
> counting duplicates for different versions or CPU architectures): 
> 
> http://gnustep.org/resources/documentation/User/GNUstep/machines_toc.html

In terms of support for LONG_LONG_MAX that breaks down to bsd platforms and 
ones which support LONG_LONG_MAX (linux and mingw/cygwin windows) with solaris 
being a strange case which has changed from being bsd to sysv over the years 
and really tends to build with almost an entire gnu toolchain.



reply via email to

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