https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118141

--- Comment #10 from Richard Yao <richard.yao at alumni dot stonybrook.edu> ---
I had thought the strict aliasing rule only applied within function scope,
although that appears to be a misunderstanding upon checking this:

https://gist.github.com/shafik/848ae25ee209f698763cffee272a58f8

This code compiles correctly:

https://godbolt.org/z/3Tdnac8TE

For my own education, is this a strict aliasing rule violation too or am I okay
because I used a union type before the void pointer?

Reply via email to