It's different viewpoints...
Posted May 29, 2011 9:51 UTC (Sun) by
nix (subscriber, #2304)
In reply to:
It's different viewpoints... by anton
Parent article:
What Every C Programmer Should Know About Undefined Behavior #3/3
I wonder why they put so much effort in "optimization" if the recommendation is to disable some or all of these "optimizations" in order to get the program working as intended.
Because one of the ways people intend their programs to work is 'fast', and because not all code is the sort of riceboy rocket science that gets broken by these optimizations? I've personally written code that fell foul of aliasing optimizations precisely twice, and every time I knew I was doing something dirty when I did it.
Come on! Who writes *(foo *)&thing_of_type_bar and doesn't think 'that is ugly and risky, there must be a better way'?
(
Log in to post comments)