diff options
author | Michael Walker <mike@barrucadu.co.uk> | 2016-02-25 17:34:07 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-02-25 23:44:08 +0100 |
commit | bb5afd3c274011c5ea302210b4c290ec1f83209c (patch) | |
tree | b6c2000e466e894207ce28dc65346853120f8548 /testsuite/tests/ghc-api | |
parent | 1badf157be3b7f604ba1ac64d2ea044d783e6e50 (diff) | |
download | haskell-bb5afd3c274011c5ea302210b4c290ec1f83209c.tar.gz |
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
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r-- | testsuite/tests/ghc-api/T7478/T7478.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/testsuite/tests/ghc-api/T7478/T7478.hs b/testsuite/tests/ghc-api/T7478/T7478.hs index dc6edb21a8..bd6fb37d8b 100644 --- a/testsuite/tests/ghc-api/T7478/T7478.hs +++ b/testsuite/tests/ghc-api/T7478/T7478.hs @@ -41,9 +41,9 @@ compileInGhc targets handlerOutput = do TargetFile file Nothing -> file _ -> error "fileFromTarget: not a known target" - collectSrcError handlerOutput flags SevOutput _srcspan style msg + collectSrcError handlerOutput flags _ SevOutput _srcspan style msg = handlerOutput $ GHC.showSDocForUser flags (queryQual style) msg - collectSrcError _ _ _ _ _ _ + collectSrcError _ _ _ _ _ _ _ = return () main :: IO () diff --git a/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr b/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr index d778df2783..a943e48a3b 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: +B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)] Top-level binding with no type signature: answer_to_live_the_universe_and_everything :: Int -B.hs:5:12: warning: +B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] • 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: In the first argument of ‘(-)’, namely ‘length [1 .. 23 * 2]’ In the expression: length [1 .. 23 * 2] - 4 -A.hs:7:1: warning: +A.hs:7:1: warning: [-Wmissing-signatures (in -Wall)] Top-level binding with no type signature: main :: IO () -B.hs:4:1: warning: +B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)] Top-level binding with no type signature: answer_to_live_the_universe_and_everything :: Int -B.hs:5:12: warning: +B.hs:5:12: warning: [-Wtype-defaults (in -Wall)] • 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: In the first argument of ‘(-)’, namely ‘length [1 .. 23 * 2]’ In the expression: length [1 .. 23 * 2] - 4 -A.hs:7:1: warning: +A.hs:7:1: warning: [-Wmissing-signatures (in -Wall)] Top-level binding with no type signature: main :: IO () |