Subject: Re: C Language Standard(s)
To: David Gilbert <dgilbert@pci.on.ca>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: current-users
Date: 12/20/1995 08:08:01
On Wed, 20 Dec 1995 10:46:50 -0500
David Gilbert <dgilbert@pci.on.ca> wrote:
> IMHO, long != pointer and int != pointer... and neither should
> be coersed to the other, ever. It's just BAD.
"In a perfect world..."
Try telling that to all the third-party software that makes assumptions
like sizeof(long) == sizeof(char *). Some actually make the
sizeof(int) == sizeof(char *), which isn't the case on the alpha. I
remember many commits from Chris changing those cases to longs (in _our_
source tree ... it's not just limited to third-party). And how we have a
common userland, and almost common kernel tree for the alpha, somethings
which just wasn't trivial to do.
There's also cases where it makes arithmetic with pointers (not to be
confused with pointer arithmetic) *much* easier.
Anyhow, it's also the case on just about every other system I've used
(I'm trying to think of an exception, but haven't had my coffee yet, so
I'm not making any strict guarantees :-) that longs are the same size as
pointers. Being able to make that assumption just makes things a lot
easier with mixing 32-bit and 64-bit worlds.
Anyhow, for ages hackers have made implementation simpler (even possible
:-) by making assumptions which were basically true everywhere. I think
that if you change the semantics now, you'll be surprised what breaks.
--------------------------------------------------------------------------
Jason R. Thorpe thorpej@nas.nasa.gov
NASA Ames Research Center Home: 408.866.1912
NAS: M/S 258-6 Work: 415.604.0935
Moffett Field, CA 94035 Pager: 415.428.6939