diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-02-27 23:36:11 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-02-27 23:45:35 +0100 |
commit | 46f3775c683faeb710c9dc22f360f39334947d73 (patch) | |
tree | c365cd820603f01c4b97392fe3824e014160d5a6 | |
parent | 3cd4c9ca4564982cf159f11f59d434235ba28808 (diff) | |
download | haskell-46f3775c683faeb710c9dc22f360f39334947d73.tar.gz |
Default to -fno-show-warning-groups (re #10752)
As `-fno-show-warning-groups` shows associated warning groups regardless
of whether the respective warning group flag as been passed on the CLI,
the warning-group information may be confusing to users.
At this point, `-fshow-warning-groups` is useful mostly to GHC
developers and possibly GHC users who want to see which warning groups
an emitted warning is part of. (Btw, this is particularly interesting in
combination with `-Weverything` which enables *every* warning flag known
to GHC.)
Consequently, starting with this commit, one has to opt-in via
`-fshow-warning-groups` for GHC to show warning groups.
In order to reduce the testsuite delta in this commit, the
`-fshow-warning-groups` flag has been added to TEST_HC_OPTS.
-rw-r--r-- | compiler/main/DynFlags.hs | 3 | ||||
-rw-r--r-- | docs/users_guide/using-warnings.rst | 7 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 2 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr | 12 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T9293.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci024.stdout | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci057.stdout | 4 |
7 files changed, 21 insertions, 12 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index ebfd861237..8f9fbbb567 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -3617,8 +3617,7 @@ defaultFlags settings Opt_ProfCountEntries, Opt_RPath, Opt_SharedImplib, - Opt_SimplPreInlining, - Opt_ShowWarnGroups + Opt_SimplPreInlining ] ++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns] diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst index 3f24f6a6dc..ffe5a41fb0 100644 --- a/docs/users_guide/using-warnings.rst +++ b/docs/users_guide/using-warnings.rst @@ -103,13 +103,14 @@ The following flags are simple ways to select standard "packages" of warnings: default, but can be useful to negate a :ghc-flag:`-Werror` flag. When a warning is emitted, the specific warning flag which controls -it, as well as the group it belongs to, are shown. +it is shown. .. ghc-flag:: -fshow-warning-groups - Name the group a warning flag belongs to. + When showing which flag controls a warning, also show the + respective warning group flag(s) that warning is contained in. - This is enabled by default. Disable with ``-fno-show-warning-groups``. + This option is off by default. The full set of warning options is described below. To turn off any warning, simply give the corresponding ``-Wno-...`` option on the diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index aa20a42a65..97ceb39cb9 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -34,7 +34,7 @@ endif # TEST_HC_OPTS is passed to every invocation of TEST_HC # in nested Makefiles -TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS) +TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -fshow-warning-groups -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS) # The warning suppression flag below is a temporary kludge. While working with # tests that contain tabs, please de-tab them so this flag can be eventually diff --git a/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr b/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr index a943e48a3b..80b94dca4b 100644 --- a/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr +++ b/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr @@ -1,9 +1,9 @@ -B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)] +B.hs:4:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: answer_to_live_the_universe_and_everything :: Int -B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] +B.hs:5:12: warning: [-Wtype-defaults] • Defaulting the following constraints to type ‘Integer’ (Enum a0) arising from the arithmetic sequence ‘1 .. 23 * 2’ at B.hs:5:12-20 @@ -12,14 +12,14 @@ B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] In the first argument of ‘(-)’, namely ‘length [1 .. 23 * 2]’ In the expression: length [1 .. 23 * 2] - 4 -A.hs:7:1: warning: [-Wmissing-signatures (in -Wall)] +A.hs:7:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: main :: IO () -B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)] +B.hs:4:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: answer_to_live_the_universe_and_everything :: Int -B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] +B.hs:5:12: warning: [-Wtype-defaults] • Defaulting the following constraints to type ‘Integer’ (Enum a0) arising from the arithmetic sequence ‘1 .. 23 * 2’ at B.hs:5:12-20 @@ -28,5 +28,5 @@ B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] In the first argument of ‘(-)’, namely ‘length [1 .. 23 * 2]’ In the expression: length [1 .. 23 * 2] - 4 -A.hs:7:1: warning: [-Wmissing-signatures (in -Wall)] +A.hs:7:1: warning: [-Wmissing-signatures] Top-level binding with no type signature: main :: IO () diff --git a/testsuite/tests/ghci/scripts/T9293.stdout b/testsuite/tests/ghci/scripts/T9293.stdout index 67fc63058e..02ee22c7e8 100644 --- a/testsuite/tests/ghci/scripts/T9293.stdout +++ b/testsuite/tests/ghci/scripts/T9293.stdout @@ -7,6 +7,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is not enabled options currently set: none. @@ -21,6 +22,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should work, GADTs is in force from :set options currently set: none. @@ -34,6 +36,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is now disabled base language is: Haskell2010 @@ -49,6 +52,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is only enabled at the prompt C :: T Int diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout b/testsuite/tests/ghci/scripts/ghci024.stdout index 9fea9464b0..b92adad855 100644 --- a/testsuite/tests/ghci/scripts/ghci024.stdout +++ b/testsuite/tests/ghci/scripts/ghci024.stdout @@ -8,6 +8,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fforce-recomp -fimplicit-import-qualified + -fshow-warning-groups warning settings: -Wno-tabs ~~~~~~~~~~ Testing :set -a diff --git a/testsuite/tests/ghci/scripts/ghci057.stdout b/testsuite/tests/ghci/scripts/ghci057.stdout index 67fc63058e..02ee22c7e8 100644 --- a/testsuite/tests/ghci/scripts/ghci057.stdout +++ b/testsuite/tests/ghci/scripts/ghci057.stdout @@ -7,6 +7,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is not enabled options currently set: none. @@ -21,6 +22,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should work, GADTs is in force from :set options currently set: none. @@ -34,6 +36,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is now disabled base language is: Haskell2010 @@ -49,6 +52,7 @@ GHCi-specific dynamic flag settings: other dynamic, non-language, flag settings: -fno-ghci-history -fimplicit-import-qualified + -fshow-warning-groups warning settings: Should fail, GADTs is only enabled at the prompt C :: T Int |