4 ms·
I've said before¹ that I'm convinced that ‘undefined behavior’ was an actual mistake by the C89 committee that would not have been accepted if anyone at the tim
by kps 4y ago
I've said before¹ that I'm convinced that ‘undefined behavior’ was an actual mistake by the C89 committee that would not have been accepted if anyone at the time had realized the future implications. It is precisely “a license for the compiler to undertake aggressive optimizations that are completely legal by the committee's rules, but make hash of apparently safe programs” (as dmr said of `noalias`²).
¹ https://news.ycombinator.com/item?id=30024867 https://news.ycombinator.com/item?id=30024867
² https://www.lysator.liu.se/c/dmr-on-noalias.html https://www.lysator.liu.se/c/dmr-on-noalias.html
- rramadass 4y ago> was an actual mistake by the C89 committee Agreed. Apparently the first compiler written by Dennis Ritchie had no UB (i have not been able to find more info. on this). See also the article published in IEEE : Dealing With C's Original Sin by Chris Hathhorn and Grigore Rosu.