|sizeof(int) in 64-bit C compilers email@example.com (1995-12-17)|
|Re: sizeof(int) in 64-bit C compilers firstname.lastname@example.org (Jaap van Ganswijk) (1995-12-18)|
|Re: sizeof(int) in 64-bit C compilers email@example.com (Larry Rau) (1995-12-18)|
|Re: sizeof(int) in 64-bit C compilers firstname.lastname@example.org (1995-12-19)|
|Re: sizeof(int) in 64-bit C compilers email@example.com (1995-12-19)|
|Re: sizeof(int) in 64-bit C compilers firstname.lastname@example.org (Richard L. Kennell) (1995-12-19)|
|Re: sizeof(int) in 64-bit C compilers email@example.com (1995-12-28)|
|Re: sizeof(int) in 64-bit C compilers firstname.lastname@example.org (1995-12-28)|
|From:||Jaap van Ganswijk <email@example.com>|
|Date:||18 Dec 1995 19:10:51 -0500|
At 12:38 AM 12/17/95 -0500, Duane Sand wrote:
>A number of machines now support 32-bit and 64-bit addressing equally
>well, and some even have suitable C compilers that support both forms
>of programs. I would like to know which of these compilers have
>defined "int" to be 64-bits in their 64-bit-pointer codegen model, and
>which compilers have kept "int" as 32-bits as in their 32-bit-pointer
>model. The machines where this question arises include
> HP-PA, Sparc, Mips, Alpha, PowerPC.
The DEC-C compiler for DEC's OSF/1 (heet nu Dec Unix) on the
Alpha has int's of 32-bit and long's of 64-bit. (In 64-bit pointer code.)
>The Mips/SGI compilers define "int" as 32 bits in 32-bit-pointer code,
>and 64 bits in 64-bit-pointer code.
You are supposed to use the 32-bit pointer translation option only to
more easily port foreign or old (32-bit pointer) programs.
>This question is not just about C, since this choice tends to affect
>register-level call/return conventions for all languages on that
>machine, and whether programs can contain a mix of 32- and
Indeed, it resulted in some nasty porting problems, especially
with implicit casting via function arguments and return values.
I also had code to swap the bytes in big/little endian numbers,
that assumed, that the 'higher 32-bit part' of a long was non-existing
and therefore filled with zeroes...
>Do any of the 64-bit-pointer versions of Unix support a mix of pointer
>sizes, via near and far qualifiers?
DEC doesn't, it seems.
The new ANSI-C standard may add a new type for 64-bit
integers, I read. I would certainly appreciate types like:
int8, int16, int32, int64 to be able to handle structured foreign
file data (like COFF-files) in a more portable fashion.
For the time being I defined these types in an include file...
It would also be nice to be able to handle big and little
endian type data (for example on a foreign file system)
in a portable way, but that is another matter...
-- Chip Directory
-- http://www.hitex.com/chipdir/ - USA
-- http://www.xs4all.nl/~ganswijk/chipdir/ - Europe
-- (Many other international mirror sites from there...)
Return to the
Search the comp.compilers archives again.