What should "sizeof (expression)" return? Why "8" ??

Henry Spencer henry at utzoo.uucp
Sun Dec 11 09:14:39 AEST 1988


In article <2976 at arcturus> evil at arcturus.UUCP (Wade Guthrie) writes:
>sizeof (i+r) -- well, here we have to look at the promotion rules for 
>expressions.  On silly compilers (like that on a VAX running VMS),
>all floats get promoted to doubles...

Not too silly, actually, since this behavior was required by the old
C standards (K&R and its immediate descendants).
-- 
SunOSish, adj:  requiring      |     Henry Spencer at U of Toronto Zoology
32-bit bug numbers.            | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list