Subject: Re: gcc-ansi -pedantic and long long on NetBSD
To: James W. Williams <email@example.com>
From: Chris G. Demetriou <firstname.lastname@example.org>
Date: 10/30/1994 16:14:20
> The gcc-based ANSI C compiler on my DEC alpha uses
> long 64 bit
> int 32 bit
> short 16 bit
> char 8 bit
> Seems like a "reasonable" way to support 64 bit ints! DEC had the
> great advantage, however, of not having to support old, 32bit alpha
> code, for the simple reason that there isn't any. SGI on the other
> hand uses "long long" as it's 64-bit integral type, because they didn't
> want to break old code.
> Personally, I greatly prefer the DEC version, with long = 64 bit, but
> I realize that it just isn't practical to make this change to old code.
I agree, this is nice, and it's the only rational solution for the
alpha architecture. long should be 64 bits on the alpha.
However, 'long' should _not_ be 64 bits on 32-bit machines, if only
because you've got a lot of software that will suffer serious
performance penalties (two memory accesses per long) if it is.
i wish ANSI (or K&R, to begin with) had, in addition to short,
int, and long, also defined explicit-length types. If they had, then
you wouldn't see abominations like the RPC code, where 'long' _really_
means 32 bits, but you can't change the 'long *'s because they're part
of a well known and widely used interface.