bearophile Wrote:

> - C Standard says that assigning to one member of a union and then accessing 
> a different member is undefined behaviour.
> - GCC is a practical compiler, so it has the -fno-strict-aliasing switch, 
> that allows to use that trick. See "-Wstrict-aliasing" and:
> http://stackoverflow.com/questions/2906365/gcc-strict-aliasing-and-casting-through-a-union
> - Walter said that regarding such union semantics D acts as C. So that union 
> trick will break with other future D compilers.

I believe that defined behavior within an area where C is specified to be 
undefined is completely in line with operating as C does. But where does Walter 
say Unions act as C in this case? Why not, define the behavior and leave it.

Reply via email to