Block Initialization; structs and sizeof

Pedz Thing pedz at bobkat.UUCP
Thu Oct 16 07:14:40 AEST 1986


In article <1971 at dciem.UUCP> msb at dciem.UUCP (Mark Brader) says that in
effect (&variable + sizeof(variable) > &nextvariable) is possible.
While I understand his argument and reasoning, I hope that this is not
true.  This would break many things it seems to me.  In particular,
varargs would be a very difficult thing to write since the "nextarg"
(or whatever it is called) would have to know the type of the next
argument in order to figure out the padding.  (I guess the compiler
could make an exception in the case of parameters passed on the
stack.)  It just seems like frequently code assumes that the
sizeof(variable) is exactly equal to the offset of that variable from
the next one.
-- 
Perry Smith
ctvax ---\
megamax --- bobkat!pedz
pollux---/



More information about the Comp.lang.c mailing list