3 ms·
I'm really not surprised. I read the other article and immediately thought of the select isn't broken story from The Pragmatic Programmer and at the various bug
by dkersten 17y ago
I'm really not surprised. I read the other article and immediately thought of the select isn't broken story from The Pragmatic Programmer and at the various bugs I have encountered myself, especially in C and C++, where it would have been tempting to blame the tools, but int he end turned out to be memory issues or race conditions.
Blaming the compiler is an easy cop out and this proves that it rarely actually is the case. This guy is experienced and clever, but he still fell for the its a compiler bug trap. I'm glad he found the real bug and, hopefully, learned his lesson.
I'll reiterate what I said in a comment to the other article - I think that there should be a universal law of programming in languages like C that says that you must, at a minimum, urn compiler warnings to maximum and make sure it compiles without any warning; run your program through tools such as valgrind and ensure it passes without error. And if debugging information of optimizations make bugs appear/disappear then you need to double check everything - its probably a memory alignment issue.