Context Variables

Joseph S. D. Yao jsdy at hadron.UUCP
Tue Dec 3 15:56:01 AEST 1985


On most "reasonable" machine architectures, any scalar or pointer
data type should fit into a long.  However, in C, a pointer isn't
defined to fit into a long (or be in any way commensurable with
a scalar data type), so you may have problems on some of the more
different architectures.  Supposedly, sizeof(long) >= sizeof(int)
>= sizeof(short), although I have seen someone argue on this net
that it was legitimate to have an int whose size > sizeof(long).
I never saw anyone bother to refute that; but I think it's not
likely.  When they are implemented, a (void*) will hold any
pointer data type, so a union {long; void *;} should hold any
object.  But, to help preserve your own sanity and follow the
Prime Rule ("say what you mean"), you really should make a union
of all the different data types with which you'll be working.
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list