[commit: ghc] master: Default to -fno-show-warning-groups (re #10752) (46f3775)

git at git.haskell.org git at git.haskell.org
Sat Feb 27 23:17:35 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/46f3775c683faeb710c9dc22f360f39334947d73/ghc

>---------------------------------------------------------------

commit 46f3775c683faeb710c9dc22f360f39334947d73
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Feb 27 23:36:11 2016 +0100

    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.


>---------------------------------------------------------------

46f3775c683faeb710c9dc22f360f39334947d73
 compiler/main/DynFlags.hs                                |  3 +--
 docs/users_guide/using-warnings.rst                      |  7 ++++---
 testsuite/mk/test.mk                                     |  2 +-
 testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr | 12 ++++++------
 testsuite/tests/ghci/scripts/T9293.stdout                |  4 ++++
 testsuite/tests/ghci/scripts/ghci024.stdout              |  1 +
 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 ebfd861..8f9fbbb 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 3f24f6a..ffe5a41 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 aa20a42..97ceb39 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 a943e48..80b94dc 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 67fc630..02ee22c 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 9fea946..b92adad 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 67fc630..02ee22c 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



More information about the ghc-commits mailing list