{"id":2233,"date":"2005-11-18T16:08:00","date_gmt":"2005-11-18T16:08:00","guid":{"rendered":"https:\/\/test.simple-talk.com\/uncategorized\/always-set-warnings-as-errors\/"},"modified":"2016-07-28T10:48:41","modified_gmt":"2016-07-28T10:48:41","slug":"always-set-warnings-as-errors","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/always-set-warnings-as-errors\/","title":{"rendered":"Always set Warnings as Errors"},"content":{"rendered":"<p>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 &#8220;yup, I&#8217;ll fix it tomorrow&#8221;. 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.<\/p>\n<p>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. <\/p>\n<p>It&#8217;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.)<\/p>\n<p>It maybe a painful road but in the end the builds are always better and easier to understand because there are never any warnings. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;yup, I&#8217;ll fix it tomorrow&#8221;. Unfortunately tomorrow never comes and the warning just get left in. Before you know it when you build a project there are hundreds of&#8230;&hellip;<\/p>\n","protected":false},"author":48422,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[],"class_list":["post-2233","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/48422"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=2233"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2233\/revisions"}],"predecessor-version":[{"id":24202,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/2233\/revisions\/24202"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=2233"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}