3 ms·
The problem is these sorts of things are trivia. They are things that sufficiently smart tooling should handle for us so people can spend time building higher
by admax88q 9y ago
The problem is these sorts of things are trivia. They are things that sufficiently smart tooling should handle for us so people can spend time building higher level constructs and less time worrying about individual bits.
A smart compiler should have caught (a + b) / 2 and fixed it to be correct, there's no way the overflow situation is what the programmer wanted.
- throwaway91111 9y ago"sufficiently smart tooling" has got to be one of the best jokes in programming. On one hand, it is true that the tooling is possible. On the other hand, it remains an open problem.
- majewsky 9y agohttp://wiki.c2.com/?SufficientlySmartCompiler http://wiki.c2.com/?SufficientlySmartCompiler
- khedoros1 9y agoI'd accept a warning, but a C compiler shouldn't be making guesses at what the programmer intended. In another language? Sure, if it's consistent with other behaviors in that language.