how about sizeof(((type *)1)->member) ?

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Oct 28 04:41:14 AEST 1989


In article <1989Oct27.141015.20578 at talos.uucp> kjones at talos.uu.net writes:
>If sizeof(((type *)0)->member) is forbidden, then is
>sizeof(((type *)1)->member) forbidden as well, in pANS
>conforming programs?

The latter is not guaranteed to work in all implementations,
due to variation in addressing architectures (and memory "models").
For example, "type" objects may require quadword alignment,
and the compiler can easily tell that the address constant value 1
does not satisfy that constraint.



More information about the Comp.lang.c mailing list