increment casted void pointer -- ANSI?

Doug Gwyn gwyn at smoke.brl.mil
Sun Mar 31 00:00:53 AEST 1991


In article <3548 at inews.intel.com> bhoughto at pima.intel.com (Blair P. Houghton) writes:
>	x.i = 4;
>	y = &x;
>	z = y->f;
>It seems to me that this is nowhere permitted to return
>the bits of `4' in the float-value, nor prohibited from it.
>(I doubt very much that it would return `4.0').  Sure it'd
>be a cute thing to have around, but can one _rely_ on it
>and claim portability re X3.159-1989?

No, we were talking about the other way around,
and I wasn't claiming portability, just a method that had to be
accepted by a conforming implementation, although due to variation
in the ways that implementations represent values it would be
expecting too much to ask for portability here.

Certainly one should not be surprised to get an "invalid operand"
exception when attempting the above, as the bit pattern may not
be a valid floating-point representation.



More information about the Comp.lang.c mailing list