Implement fine-grained `-Werror=...` facility
authorMaciej Bielecki <zyla@prati.pl>
Mon, 21 Nov 2016 22:08:45 +0000 (17:08 -0500)
committerBen Gamari <ben@smart-cactus.org>
Mon, 21 Nov 2016 22:08:57 +0000 (17:08 -0500)
commit514acfe4c4e61941c2fa2e06cff02f6e4424e5e6
tree7b08577f13bb839083d3d194d75069547fb00cd5
parentea76a213d14709ded827abeb2246e4daa154e92e
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
14 files changed:
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
compiler/main/HscTypes.hs
docs/users_guide/using-warnings.rst
testsuite/tests/warnings/should_compile/Werror01.hs [new file with mode: 0644]
testsuite/tests/warnings/should_compile/Werror01.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_compile/Werror02.hs [new file with mode: 0644]
testsuite/tests/warnings/should_compile/Werror02.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_compile/all.T
testsuite/tests/warnings/should_compile/sel_werror.hs [new file with mode: 0644]
testsuite/tests/warnings/should_fail/WerrorFail.hs [new file with mode: 0644]
testsuite/tests/warnings/should_fail/WerrorFail.stderr [new file with mode: 0644]
testsuite/tests/warnings/should_fail/all.T [new file with mode: 0644]
utils/mkUserGuidePart/Options/Warnings.hs