--- Comment #3 from ebotcazou at gcc dot gnu dot org 2007-04-29 19:58
---
> Given that "A character type may alias any other type.",
> I suppose I should be able to use (it works):
>
> memcpy(&out->fraction, &value, 4);
> memcpy(&out->mantissa, 4+(char*)&value, 4);
> out->mantissa &= 0
--- Comment #2 from ajrobb at bigfoot dot com 2007-04-29 19:51 ---
Thanks,
I'd forgotten that you can only alias through char* (or types related to the
operand).
Given that "A character type may alias any other type.",
I suppose I should be able to use (it works):
memcpy(&out->fraction
--- Comment #1 from ebotcazou at gcc dot gnu dot org 2007-04-28 16:53
---
> #if 0
> /* abuse union to cast (long double) to int[] - but it works */
> result.value = value;
> out->fraction = result.array[0];
> out->mantissa = result.array[1] & 0x7fff;
> #else
> /* this is o