strict aliasing violation
Piotr Wyderski
piotr.wyderski@gmail.com
Mon Jan 25 16:31:00 GMT 2010
Andrew Haley wrote:
>>> union { float f; uint32 i; } u = {.f = v};
>>> return u.i;
>>
>> Nope, that is not allowed either.
>
> Of course it is allowed. It's a legitimate gcc extension, and it's
> supported by many other compilers too.
It's a C extension, according to the documentation.
In C++ mode (-std=gnu++0x) the compiler does not
understand the "u = {.f = v}" statement. Is it a feature
or a bug? ;-)
Best regards
Piotr Wyderski
More information about the Gcc
mailing list