Bugs in the compiler
After I posted my previous blog entry a couple of things were pointed out to me, to do with my fourth point about ignoring warnings.
It turns out that unreachable code doesn't necessarily produce warnings from Apple-ish compilers like I expected it to. It turns out that in gcc the -Wunreachable-code option doesn't do anything. It's only there because it used to do something but that functionality was removed because it didn't work very well. In Clang, -Wunreachable-code is functional, but isn't enabled under -Wall. All apparently doesn't mean all in Clang-land.
I consider both of these to be compiler bugs.
All the other points I made still hold though, especially the most important one about unit testing and code coverage in tests.
Leave a comment