3 ms·
The problem is that the initial concept was botched by accident (C89) and then embraced rather than corrected by later committees. Nobody during C89 formulatio
by kps 6y ago
The problem is that the initial concept was botched by accident (C89) and then embraced rather than corrected by later committees.
Nobody during C89 formulation realized that it would end up “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” that “negates every brave promise X3J11 ever made about codifying existing practices, preserving the existing body of code, and keeping (dare I say it?) `the spirit of C.'” If they had, the response would have been that “[UB] must go. This is non-negotiable.”
- MereInterest 6y agoYou have many quotation marks, but no reference to who said them. Those aren't quotes from the articles, so I can't find where they came from.
- kps 6y agoA letter to X3J11 from some chap named Dennis Ritchie.
- raphlinus 6y agoFor people who read the comments here but not the primary sources[0], you've put words into Dennis Ritchie's mouth. He did not say that UB must go, but that noalias must go. And, lo and behold, it did. So these (altered) quotes are not at all a fair characterization of what's actually in the standard. [0]: https://www.lysator.liu.se/c/dmr-on-noalias.html https://www.lysator.liu.se/c/dmr-on-noalias.html
- kps 6y agoHe said why ‘noalias must go’, and those reasons apply equally to the modern conception of UB, so it's clear that the consequences of the definition were not realized at the time.