Bugs you expected to throw a compiler error ...,
Members - Reputation: 360
Posted 25 May 2011 - 02:24 PM
Particularly if your compile times are fairly short, it's not a bad idea to turn on all warnings and enable warnings are errors.
Members - Reputation: 102
Posted 25 May 2011 - 11:00 PM
this was about 10 years ago, and I was programming a "toy OS" (called nachOS)
it was done in C (not C++) so everything was ok, but then random errors would occur, random values sometimes, and other times those values where correct....
it didn't make sense... it took me 3 days to find out the problem, going line by line, debugging every variable etc.
// we do something here something = somethingelse; more code and more code
see the error?
obviously // is a c++ thing, so the comments had to be /* we do something here */
I just changed that and the program started to work perfectly. So yeah, don't trust the compiler. just because it said "it's ok, there are no errors here" doesn't mean it's true!