Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by throwaway91111 on Tuesday August 01, 2017 @09:53PM
(#14907266)
"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.
Re:Nearly All Binary Searches and Mergesorts Are Broken (2006)
by khedoros1 on Tuesday August 01, 2017 @10:39PM
(#14907508)
I'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.
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.