# <span class='text-muted'>099.</span> Turn compiler warnings into errors to force code defects to be fixed.

<span style='font-size: small;' class='text-muted'>topic: {ref}`style`</span>

```{note}
This tip is a draft[^draft].

[^draft]: From the perspective of FortranTip Browser, "draft" means that
  it hasn't been edited for formatting,
  hasn't had corresponding Fortran programs added,
  the text content hasn't been enhanced, etc.
  Draft texts are extracted from the corresponding Tweet using the Twitter API.
```

To ensure that code defects are fixed, use options to turn the relevant compiler warnings into errors in the build system. For example

gfortran -Werror=unused-variable -Werror=unused-function

rejects the code below. Mere warnings are often ignored.


---

<blockquote class="twitter-tweet"><p lang="en" dir="ltr">To ensure that code defects are fixed, use options to turn the relevant compiler warnings into errors in the build system. For example<br><br>gfortran -Werror=unused-variable -Werror=unused-function<br><br>rejects the code below. Mere warnings are often ignored.<a href="https://t.co/OiYA1EWwcj">pic.twitter.com/OiYA1EWwcj</a></p>&mdash; FortranTip (@fortrantip) <a href="https://twitter.com/fortrantip/status/1485235396179079173?ref_src=twsrc%5Etfw">January 23, 2022</a></blockquote><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>