From b8e30e40b08db3dd50e7a972a4969c8f8f784eaa Mon Sep 17 00:00:00 2001 From: Nathan Collins Date: Fri, 19 Oct 2018 14:44:19 -0700 Subject: Improve documentation for warning options My main goal was to make it easy to discover how to reverse `-Werror`, since `Wno-error` doesn't work, and the fact that `-Wwarn` negates `-Werror` was only mentioned in the `-Wwarn` docs before. Other changes: - explain at the outset that some options control individual warnings while others control warning families. - explain at the outset that `-Wno-` can be used to reverse `-W`. This is no mentioned in two places, but I don't think that's a bad thing. --- docs/users_guide/using-warnings.rst | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index f0c4ac4fd5..fe3c8cb58c 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -8,8 +8,13 @@ Warnings and sanity-checking single: warnings GHC has a number of options that select which types of non-fatal error -messages, otherwise known as warnings, can be generated during -compilation. By default, you get a standard set of warnings which are +messages, otherwise known as warnings, can be generated during compilation. +Some options control individual warnings and others control collections +of warnings. +To turn off an individual warning ``-W``, use ``-Wno-``. +To reverse``-Werror``, which makes all warnings into errors, use ``-Wwarn``. + +By default, you get a standard set of warnings which are generally likely to indicate bugs in your program. These are: .. hlist:: @@ -146,7 +151,9 @@ to abort. :category: Makes any warning into a fatal error. Useful so that you don't miss - warnings when doing batch compilation. + warnings when doing batch compilation. To reverse ``-Werror`` and stop + treating any warnings as errors use ``-Wwarn``, or use ``-Wwarn=`` + to stop treating specific warnings as errors. .. ghc-flag:: -Werror=⟨wflag⟩ :shortdesc: make a specific warning fatal @@ -158,7 +165,7 @@ to abort. :implies: ``-W`` Makes a specific warning into a fatal error. The warning will be enabled if - it hasn't been enabled yet. + it hasn't been enabled yet. Can be reversed with ``-Wwarn=``. ``-Werror=compat`` has the same effect as ``-Werror=...`` for each warning flag in the :ghc-flag:`-Wcompat` option group. -- cgit v1.2.1