3 ms·
The original mandate of X3J11 was to “codify common existing practice”. The published Rationale goes on to describe a number of relevant criteria, including •
by kps 9y ago
The original mandate of X3J11 was to “codify common existing practice”. The published Rationale goes on to describe a number of relevant criteria, including
• Existing code is important, existing implementations are not.
• Avoid “quiet changes.”
• Trust the programmer.
• Keep the language small and simple.
• Make it fast, even if it is not guaranteed to be portable.
In pre-ANSI C, and C89 C interpreted in line with the Rationale, if you wrote ‘+’, the expectation was that you'd get the target machine's ‘add’ instruction, no more and no less. It might overflow, it might not; it might crash or hang your machine on overflow or trap values — but that is all your problem, not the language's or compiler's. The ANSI invention of ‘undefined behaviour’ can be considered a good-faith attempt to codify things like this, but botching it was one of the two great failures of C89.
I worked on a commercial compiler at the time, and I'm confident no one thought of C89 as a license to screw the customer.
- pjmlp 9y agoThey revised that criteria list for C11, given the current state of C induced security exploits. "12. Trust the programmer, as a goal, is outdated in respect to the security and safety programming communities. While it should not be totally disregarded as a facet of the spirit of C, the C11 version of the C Standard should take into account that programmers need the ability to check their work." http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2021.htm http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2021.htm