Comment

Comment by saagarjha

Punning through a union is undefined in C++11. I'd recommend against doing it in C99 (and newer) as well, even though it has a footnote in the standard saying it's ok, since someone is going to read your code and copy it over to an earlier C project, where it would be undefined. Just use memcpy as intended and let the compiler optimize it out for you.
parent saagarjha 8 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton