News for hackers. Stuff that matters.
Re:Porting the Go compiler from C to Go by bzbarsky on Saturday April 26, 2014 @09:10PM (#7653449)
Sure, but that's an aliasing issue, not a type punning issue. I agree that the code you cite there is a violation of the aliasing rules, and will not work "as expected" on modern compilers unless one does the equivalent of gcc's -fno-strict-aliasing.

And I agree that the corrigendum doesn't apply in this case. Once you hand different-typed pointers to the same memory to people, whether via union or just casting pointers, the aliasing rules will up and bite you.

There are no comments on this comment yet.