This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Builtin types, <limits.h>, <stdint.h>, aix64, etc.


> Date: Sat, 8 Jul 2000 23:56:01 +0200
> From: "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>

> > As an example, on AIX/ppc the size of 'long' and pointers can be 32
> > bits or 64 bits, controlled by a compiler switch, and the header files
> > and libraries adjust themselves.
> > 
> > The significance of this is that intptr_t needs to change depending on
> > the setting of this flag.
> 
> I see. I assume that the adjustment of the headers is done with
> preprocessor defines. Would it be better to adjust <stdint.h> by the
> same preprocessor defines, or by compiler built-in typedefs?

Actually, the adjustment for LONG_MAX is presently not done at all (I
just found and fixed that problem) but it's going to be done by having
the specs file define __LONG_MAX__ in the preprocessor.  

An alternative, which I rejected, was to change the header file
gcc/glimits.h to fix the existing condition:

#if defined (__alpha__) || (defined (_ARCH_PPC) && defined (__64BIT__)) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)

but clearly this is not a scalable solution.  It's also error-prone,
as demonstrated by the bug (the bug is that _ARCH_PPC is not defined
in common or POWER modes).

-- 
- Geoffrey Keating <geoffk@cygnus.com>

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