Subject: Re: C Language Standard(s)
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 12/20/1995 06:28:36
>> How much code would we *really* break if we moved long to 64 bit,
> "A lot."  In order for 32-bit and 64-bit code to live together in the
> Grand Scheme Of Things, NetBSD currently assumes that a pointer and
> long are the same size (i.e. pointers are often cast to longs).

Casts like that doesn't assume pointers and longs are the same size; it
assumes pointers are no larger than longs - and _that_ assumption would
not be broken by enlarging longs.

> I can only imagine what would happen if we made that change and then
> started having to conditionally #ifdef code to cast pointers to longs
> on the alpha and ints everywhere else.

Nothing worse than encountering a machine where pointers are larger
than any convenient int size. :-)  I actually would prefer to see a
ptrcast_t typedef somewhere, used for all cast-from-pointer integers.

I also think that code that believes it's useful to cast pointers to
integers and back should be eliminated; I have trouble seeing a case
where it's really a useful thing to do.  (The only thing _I_ ever do it
for is to print pointers out for debugging with old printfs that don't
support %p.)

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu