A rather obscure FP question.
Doug Gwyn (VLD/VMB)
uunet!BRL.MIL!gwyn
Tue Mar 9 09:07:46 PST 1993
I don't understand why it is even an issue. The operand of sizeof is
not "evaluated" as in executed, but merely inspected by the compiler
to determine the operand's type. License for run-time evaluation to
higher precision of representation has nothing at all to do with the
type system. double*double is an expression resulting in type double,
and sizeof that is however many bytes are allocated (including possible
padding) by the implementation for storage of an object of type double.
Typically that's something like 8.
It's possible that I contributed to the confusion some time back when I
argued against "sizeof(1/0)" and similar constructs in strictly conforming
programs, but various people on X3J11 straightened me out on that later.
The operand of sizeof is "evaluated" only insofar as some type algebra is
performed to determine the resultant type of the operand of sizeof.
More information about the Numeric-interest
mailing list