News for hackers. Stuff that matters.
Re:The Byte Order Fiasco by jart on Monday May 10, 2021 @12:07AM (#27102590)
Why is it not ok to convert from a char? Some of the information in the gist is wrong. Type punning with unions for example is legal. ANSI X3.159-1988 is quite clear on that point in its aliasing rules. I've seen a lot of comments people post online saying you must use memcpy to read the bits in a float or that c++ forbids union punning but where is that written. Since if that were true every math library would break.

There are no comments on this comment yet.