Hacker News new | ask | show | jobs
by gshrikant 2858 days ago
I'm curious, AFAICT Linux uses -fno-strict-aliasing with GCC which promises not to enable strict aliasing based optimizations even at higher optimization levels. But they also rely on the GCC blessed behavior of union based type punning which is redundant in that case.

I suppose union based type punning makes the intent a little clearer (vis a vis memcpy) but that's a weak argument at best.

1 comments

> I suppose union based type punning makes the intent a little clearer (vis a vis memcpy) but that's a weak argument at best.

How much more explicit can you get than a memcpy?

I meant the fact that you're actually reinterpreting bits and not really copying them somewhere.