Compiler Warnings – Understanding and Resolving Them

compiler

Many compilers have warning messages to warn the programmers about potential runtime, logic and performance errors, most times, you quickly fix them, but what about unfixable warnings?

How do you deal with unfixable warnings? Do you re-write a portion of the code, or rewrite it in the "long, hackless way" or disable warnings all together? What should be the best practice?

What if you are editing someone else's code and his code has warnings?

Here is a good example:
jQuery has a lots of JavaScript warnings as a Mozilla-class browser detected, why the jQ developers don't fix them? If you contribute to jQuery, are you going to fix them?

Best Answer

Some warning are usually safe to ignore but if you do so then over time they'll multiply until that day comes when there are so many that you miss the one warning that really matters because it's hidden in the noise.

Fix warnings immediately (which may include disabling individual rules if you feel that it's never relevant for your context).

Related Topic