I\'ve worked on many projects where I\'ve been given code by others to update. More often than not I compile it and get about 1,000+ compiler warnings. When I see compiler w
The worst part is that when you write new code, its hard to know if you've accidentally introduced more warnings, since there are so many you just ignore them anyways.
The problem with cleaning them all up, is that it takes time that you may or may not have. But yes, generally you should clean up as many as you can.
I have worked with a number of embedded systems where the warnings will result in instability, crashing, or memory corruption. Unless you know the warning is innocuous, it should be dealt with.
Always clean up all warnings or explicitly suppress them if needed. The default settings for warnings should be highest possible when compiling (level 4 on VS for example).
Warnings are and should be treated as bugs. If you can't code well enough to get rid of your warnings then you probably shouldn't be coding. In my group we made the decision to force all warnings to errors. It ends this discussion altogether and really, IMHO, improves code quality.
There are some instances where I will leave warnings in code, or where it's infeasible to clean them up (although I do remove the ones I can). For example:
Anyway, those are the instances off the top of my head where leaving warnings might be appropriate.
I try to compile code with a fairly high level of warnings and clean them all up, except for "signed / unsigned comparison" warnings, which I'm sure I should fix but can never be bothered.
Short version: In g++ I use "-Wextra -Wno-sign-compare" and get rid of all messages.