Broken compilers (Was Portability of passing/operating on structures)

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Oct 26 18:45:30 AEST 1988


In article <7356 at ihlpl.ATT.COM> knudsen at ihlpl.ATT.COM (Knudsen) writes:
>Actually I like the semantics that casting any pointer to (char *)
>means "keep the numerical address value the same."

Conversion from a (object *) to a (char *) produces a pointer to
the first byte in the object (thought of as an array of bytes).
Whether the first byte is most or least significant within a
larger machine integer depends on the architecture.
The numerical address (i.e. what you'd get by casting to an
integer) need not be the same for the two pointer sizes,
although it often will be.



More information about the Comp.lang.c mailing list