diff options
author | Maciej Bielecki <zyla@prati.pl> | 2016-11-21 17:08:45 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-21 17:08:57 -0500 |
commit | 514acfe4c4e61941c2fa2e06cff02f6e4424e5e6 (patch) | |
tree | 7b08577f13bb839083d3d194d75069547fb00cd5 /docs/users_guide/using-warnings.rst | |
parent | ea76a213d14709ded827abeb2246e4daa154e92e (diff) | |
download | haskell-514acfe4c4e61941c2fa2e06cff02f6e4424e5e6.tar.gz |
Implement fine-grained `-Werror=...` facility
This patch add new options `-Werror=...`, `-Wwarn=...` and
`-Wno-error=...` (synonym for `-Wwarn=...`).
Semantics:
- `-Werror` marks all warnings as fatal, including those that don't
have a warning flag, and CPP warnings.
- `-Werror=...` enables a warning and marks it as fatal
- `-Wwarn=...` marks a warning as non-fatal, but doesn't disable it
Test Plan: validate
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: mpickering, svenpanne, RyanGlScott, thomie
Differential Revision: https://phabricator.haskell.org/D2706
GHC Trac Issues: #11219
Diffstat (limited to 'docs/users_guide/using-warnings.rst')
-rw-r--r-- | docs/users_guide/using-warnings.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index c9216b9307..fdda600773 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -92,16 +92,33 @@ The following flags are simple ways to select standard "packages" of warnings: Turns off all warnings, including the standard ones and those that :ghc-flag:`-Wall` doesn't enable. +These options control which warnings are considered fatal and cause compilation +to abort. + .. ghc-flag:: -Werror Makes any warning into a fatal error. Useful so that you don't miss warnings when doing batch compilation. +.. ghc-flag:: -Werror=<wflag> + + :implies: ``-W<wflag>`` + + Makes a specific warning into a fatal error. The warning will be enabled if + it hasn't been enabled yet. + .. ghc-flag:: -Wwarn Warnings are treated only as warnings, not as errors. This is the default, but can be useful to negate a :ghc-flag:`-Werror` flag. +.. ghc-flag:: -Wwarn=<wflag> + + Causes a specific warning to be treated as normal warning, not fatal error. + + Note that it doesn't fully negate the effects of ``-Werror=<wflag>`` - the + warning will still be enabled. + When a warning is emitted, the specific warning flag which controls it is shown. |