Always set Warnings as Errors

Comments 0

Share to social media

How many of us have developed some code only to find the compiler outputs some warnings such as unused parameter, or unreachable code and just thought “yup, I’ll fix it tomorrow”. Unfortunately tomorrow never comes and the warning just get left in. Before you know it when you build a project there are hundreds of warnings and the new ones just get missed.

As a result I have found that the only way forward is to set warnings as errors and crank the warning level as high as possible.

It’s a bit radical however developers must then either fix the warnings or suppress them.(Developers will only suppress warnings when there is no way round and do not suppress warnings unnecessarily.)

It maybe a painful road but in the end the builds are always better and easier to understand because there are never any warnings.

Load comments

About the author

David Connell

See Profile

David Connell is a Software Developer who led the team that created the SQL Data Generator at Red-Gate. Before then, he led the 'SQL Toolbelt' installer and the SQL Doc team, and before that worked in the SQL Bundle 5.0 team. He was previously a Senior Software engineer at Pi Research. In his spare time David Connell develops other software packages with a Dutch Company, Thermimport Quality Control.

David Connell's contributions