Print which warning-flag controls an emitted warning
authorMichael Walker <mike@barrucadu.co.uk>
Thu, 25 Feb 2016 16:34:07 +0000 (17:34 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Thu, 25 Feb 2016 22:44:08 +0000 (23:44 +0100)
commitbb5afd3c274011c5ea302210b4c290ec1f83209c
treeb6c2000e466e894207ce28dc65346853120f8548
parent1badf157be3b7f604ba1ac64d2ea044d783e6e50
Print which warning-flag controls an emitted warning

Both gcc and clang tell which warning flag a reported warning can be
controlled with, this patch makes ghc do the same. More generally, this
allows for annotated compiler output, where an optional annotation is
displayed in brackets after the severity.

This also adds a new flag `-f(no-)show-warning-groups` to control
whether to show which warning-group (such as `-Wall` or `-Wcompat`)
a warning belongs to. This flag is on by default.

This implements #10752

Reviewed By: quchen, bgamari, hvr

Differential Revision: https://phabricator.haskell.org/D1943
163 files changed:
compiler/coreSyn/CoreLint.hs
compiler/deSugar/Coverage.hs
compiler/ghci/Debugger.hs
compiler/ghci/Linker.hs
compiler/iface/BinIface.hs
compiler/iface/LoadIface.hs
compiler/main/CodeOutput.hs
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/ErrUtils.hs
compiler/main/ErrUtils.hs-boot
compiler/main/GhcMake.hs
compiler/main/SysTools.hs
compiler/main/TidyPgm.hs
compiler/rename/RnBinds.hs
compiler/rename/RnEnv.hs
compiler/rename/RnNames.hs
compiler/rename/RnSource.hs
compiler/rename/RnTypes.hs
compiler/simplCore/CoreMonad.hs
compiler/simplCore/SimplCore.hs
compiler/simplStg/SimplStg.hs
compiler/typecheck/Inst.hs
compiler/typecheck/TcAnnotations.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcForeign.hs
compiler/typecheck/TcInstDcls.hs
compiler/typecheck/TcMatches.hs
compiler/typecheck/TcPat.hs
compiler/typecheck/TcRnDriver.hs
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcSimplify.hs
compiler/typecheck/TcSplice.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcValidity.hs
docs/users_guide/using-warnings.rst
ghc/GHCi/UI.hs
testsuite/tests/deSugar/should_compile/ds041.stderr
testsuite/tests/deSugar/should_compile/ds053.stderr
testsuite/tests/dependent/should_compile/T11241.stderr
testsuite/tests/deriving/should_compile/T4966.stderr
testsuite/tests/deriving/should_compile/deriving-1935.stderr
testsuite/tests/deriving/should_compile/drv003.stderr
testsuite/tests/driver/werror.stderr
testsuite/tests/ffi/should_compile/T1357.stderr
testsuite/tests/ghc-api/T7478/T7478.hs
testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr
testsuite/tests/ghci/scripts/T5820.stderr
testsuite/tests/ghci/scripts/T8353.stderr
testsuite/tests/ghci/scripts/ghci019.stderr
testsuite/tests/haddock/haddock_examples/haddock.Test.stderr
testsuite/tests/indexed-types/should_compile/Class3.stderr
testsuite/tests/indexed-types/should_compile/Simple2.stderr
testsuite/tests/indexed-types/should_compile/T3023.stderr
testsuite/tests/indexed-types/should_compile/T8889.stderr
testsuite/tests/indexed-types/should_compile/UnusedTyVarWarnings.stderr
testsuite/tests/indexed-types/should_compile/UnusedTyVarWarningsNamedWCs.stderr
testsuite/tests/indexed-types/should_fail/T7862.stderr
testsuite/tests/module/mod128.stderr
testsuite/tests/module/mod14.stderr
testsuite/tests/module/mod176.stderr
testsuite/tests/module/mod177.stderr
testsuite/tests/module/mod5.stderr
testsuite/tests/module/mod89.stderr
testsuite/tests/monadfail/MonadFailWarnings.stderr
testsuite/tests/monadfail/MonadFailWarningsWithRebindableSyntax.stderr
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail05.stderr
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail06.stderr
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail11.stderr
testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail12.stderr
testsuite/tests/parser/should_compile/T2245.stderr
testsuite/tests/parser/should_compile/T3303.stderr
testsuite/tests/parser/should_compile/read014.stderr
testsuite/tests/partial-sigs/should_compile/ExprSigLocal.stderr
testsuite/tests/partial-sigs/should_compile/SplicesUsed.stderr
testsuite/tests/partial-sigs/should_compile/T10403.stderr
testsuite/tests/partial-sigs/should_compile/T10438.stderr
testsuite/tests/partial-sigs/should_compile/T10463.stderr
testsuite/tests/partial-sigs/should_compile/T10519.stderr
testsuite/tests/partial-sigs/should_compile/T11016.stderr
testsuite/tests/partial-sigs/should_compile/T11192.stderr
testsuite/tests/partial-sigs/should_compile/TypedSplice.stderr
testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
testsuite/tests/partial-sigs/should_fail/Defaulting1MROff.stderr
testsuite/tests/partial-sigs/should_fail/T11122.stderr
testsuite/tests/patsyn/should_compile/T11283.stderr
testsuite/tests/patsyn/should_fail/T11053.stderr
testsuite/tests/rename/should_compile/T1789.stderr
testsuite/tests/rename/should_compile/T17a.stderr
testsuite/tests/rename/should_compile/T17b.stderr
testsuite/tests/rename/should_compile/T17c.stderr
testsuite/tests/rename/should_compile/T17d.stderr
testsuite/tests/rename/should_compile/T17e.stderr
testsuite/tests/rename/should_compile/T1972.stderr
testsuite/tests/rename/should_compile/T3262.stderr
testsuite/tests/rename/should_compile/T3371.stderr
testsuite/tests/rename/should_compile/T3449.stderr
testsuite/tests/rename/should_compile/T4489.stderr
testsuite/tests/rename/should_compile/T5331.stderr
testsuite/tests/rename/should_compile/T5334.stderr
testsuite/tests/rename/should_compile/T5867.stderr
testsuite/tests/rename/should_compile/T7085.stderr
testsuite/tests/rename/should_compile/T7145b.stderr
testsuite/tests/rename/should_compile/T7167.stderr
testsuite/tests/rename/should_compile/T9778.stderr
testsuite/tests/rename/should_compile/mc10.stderr
testsuite/tests/rename/should_compile/rn037.stderr
testsuite/tests/rename/should_compile/rn039.stderr
testsuite/tests/rename/should_compile/rn040.stderr
testsuite/tests/rename/should_compile/rn041.stderr
testsuite/tests/rename/should_compile/rn046.stderr
testsuite/tests/rename/should_compile/rn047.stderr
testsuite/tests/rename/should_compile/rn050.stderr
testsuite/tests/rename/should_compile/rn055.stderr
testsuite/tests/rename/should_compile/rn063.stderr
testsuite/tests/rename/should_compile/rn064.stderr
testsuite/tests/rename/should_compile/rn066.stderr
testsuite/tests/rename/should_fail/T2723.stderr
testsuite/tests/rename/should_fail/T5211.stderr
testsuite/tests/rename/should_fail/T5281.stderr
testsuite/tests/rename/should_fail/T5892a.stderr
testsuite/tests/rename/should_fail/T7454.stderr
testsuite/tests/rename/should_fail/T8149.stderr
testsuite/tests/semigroup/SemigroupWarnings.stderr
testsuite/tests/simplCore/should_compile/simpl020.stderr
testsuite/tests/typecheck/prog001/typecheck.prog001.stderr
testsuite/tests/typecheck/should_compile/HasKey.stderr
testsuite/tests/typecheck/should_compile/T10935.stderr
testsuite/tests/typecheck/should_compile/T10971a.stderr
testsuite/tests/typecheck/should_compile/T2497.stderr
testsuite/tests/typecheck/should_compile/T3696.stderr
testsuite/tests/typecheck/should_compile/T4912.stderr
testsuite/tests/typecheck/should_compile/T7903.stderr
testsuite/tests/typecheck/should_compile/T9497a.stderr
testsuite/tests/typecheck/should_compile/holes.stderr
testsuite/tests/typecheck/should_compile/holes2.stderr
testsuite/tests/typecheck/should_compile/tc078.stderr
testsuite/tests/typecheck/should_compile/tc115.stderr
testsuite/tests/typecheck/should_compile/tc116.stderr
testsuite/tests/typecheck/should_compile/tc125.stderr
testsuite/tests/typecheck/should_compile/tc126.stderr
testsuite/tests/typecheck/should_compile/tc161.stderr
testsuite/tests/typecheck/should_compile/tc175.stderr
testsuite/tests/typecheck/should_compile/tc243.stderr
testsuite/tests/typecheck/should_compile/tc254.stderr
testsuite/tests/typecheck/should_fail/T5051.stderr
testsuite/tests/typecheck/should_fail/tcfail204.stderr
testsuite/tests/warnings/minimal/WarnMinimal.stderr
testsuite/tests/warnings/should_compile/DeprU.stderr
testsuite/tests/warnings/should_compile/PluralS.stderr
testsuite/tests/warnings/should_compile/T10890/T10890_2.stderr
testsuite/tests/warnings/should_compile/T11077.stderr
testsuite/tests/warnings/should_compile/T11128.stderr
testsuite/tests/warnings/should_compile/T11128b.stderr
testsuite/tests/warnings/should_compile/T2526.stderr
testsuite/tests/warnings/should_compile/T9178.stderr
testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr
utils/mkUserGuidePart/Options/Warnings.hs