Re:Undefined behavior is often a thing for C programmers (2011)
by AlotOfReading on Thursday September 03, 2020 @10:47AM
(#24364550)
Is it really fair to call type punning "well defined"? To my knowledge, it was considered implementation defined from C89 all the way through C11.
[ Parent
| on HN ]
Re:Undefined behavior is often a thing for C programmers (2011)
by sharpneli on Thursday September 03, 2020 @11:37AM
(#24365055)
Before C11 char* was the only way to do type punning, badly. So it was basically forbidden, but still well defined.
Since then they specified that unions are the way to go.