Save bytes in float variable

It’s said elsewhere, read again #6

@DrDiettrich just sleep on it.

You have been given tons of evidence that the norm makes that UB, regardless of how you want to spin it.

The fact that you intuitively see the compiler going for the easy old C way when you have your 4 bytes is not wrong per se, that’s what it does most of the time and in simple cases, but you still rely on UB.

You probably (like me) learnt C a long time ago and apply old C hacks to C++…

1 Like