__LP64__ defined on Alpha Linux?

peeterj@ca.ibm.com peeterj@ca.ibm.com
Tue Mar 28 21:28:00 GMT 2000


Sun doesn't have __LP64__, HP is the only such system that I know that uses
that one.

64 bit feature test macros that I know of are (with "native" compilers, not
gcc):

AIX : __64BIT__
HP: __LP64__
SUN: __sparcv9, _LP64
SGI: _MIPS_SZLONG==64
NT: _M_IA64

some of these require other headers to be included first (ie: SGI, Sun
_LP64), whereas others are defined by the compiler.  It would probably be
nice if all the 64 bit gcc varients used a consistent feature test macro
set for checking 32bit, 64bit'ness (possibly in addition to other platform
specific ones needed for system headers), of which there are three main
variations:

1) 32 bit int, long, and pointer (typically denoted ILP32)
2) 32 bit int, 64 bit long and pointer (LP64)
3) 32 bit int and long.  64 bit pointer (IL32P64?) -- this is microsoft's
object model for IA64.

However, that fact that gcc doesn't have consistent definitions for this
doesn't hurt too much as one should be able to add additional defines on
the command line -- it is awkward, but doable.

If definitions for things like __LP64__, __ILP32__, ... were to be added,
then they should probably be generalized, because there are plenty of other
word size target variations (8 bit, 16 bit, odd beasties like OS/400 with
16 byte pointers, ...)

The fact that the gcc for Linux alpha doesn't already have one of these
sorts of defines must be associated with the fact that there is no 32 bit
object model on this platform.  I wonder if there is any plan of adding
this, or is Linux alpha going to always mean 64 bit object model.

Peeter




More information about the Gcc mailing list