Comment by matheusmoreira

3 years ago

> he needs to accommodate that

Clearly he doesn't. He just disabled harmful features and called it a day. Stuff like strict aliasing and undefined signed integer overflow apparently do nothing but serve as an excuse for the optimizer to screw up perfectly reasonable code.

https://cellperformance.beyond3d.com/articles/2006/06/unders...

https://stackoverflow.com/q/2958633/512904

Looks like this is a pretty good approach to fixing the C language. Take the nonsensical undefined stuff and tell the compiler to define it.

Looks like there is a may_alias type attribute to tell GCC that some types may alias:

https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.ht...

I'm not sure if it's worth the effort though. Too much uncertainty.

That's not how they work but I doubt getting into an argument with you about how undefined behavior works with someone who is dead-set on it being harmful is going to be productive.