From af9612bf862daaa99384eefa3059054053ecbee8 Mon Sep 17 00:00:00 2001 From: Sean Gillespie Date: Mon, 12 Jun 2017 17:04:05 -0400 Subject: Make -w less aggressive (Trac #12056) Previously -w combined with -Wunrecognised-warning-flags would not report unrecognized flags. Reviewers: austin, bgamari, dfeuer Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #12056 Differential Revision: https://phabricator.haskell.org/D3581 --- ghc/Main.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ghc/Main.hs') diff --git a/ghc/Main.hs b/ghc/Main.hs index 0a4e17aa7d..a75aba3e97 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -46,7 +46,7 @@ import HscTypes import Packages ( pprPackages, pprPackagesSimple ) import DriverPhases import BasicTypes ( failed ) -import DynFlags +import DynFlags hiding (WarnReason(..)) import ErrUtils import FastString import Outputable @@ -149,7 +149,7 @@ main = do Right postLoadMode -> main' postLoadMode dflags argv3 flagWarnings -main' :: PostLoadMode -> DynFlags -> [Located String] -> [Located String] +main' :: PostLoadMode -> DynFlags -> [Located String] -> [Warn] -> Ghc () main' postLoadMode dflags0 args flagWarnings = do -- set the default GhcMode, HscTarget and GhcLink. The HscTarget @@ -543,7 +543,7 @@ isCompManagerMode _ = False parseModeFlags :: [Located String] -> IO (Mode, [Located String], - [Located String]) + [Warn]) parseModeFlags args = do let ((leftover, errs1, warns), (mModeFlag, errs2, flags')) = runCmdLine (processArgs mode_flags args) @@ -554,7 +554,7 @@ parseModeFlags args = do -- See Note [Handling errors when parsing commandline flags] unless (null errs1 && null errs2) $ throwGhcException $ errorsToGhcException $ - map (("on the commandline", )) $ map unLoc errs1 ++ errs2 + map (("on the commandline", )) $ map (unLoc . errMsg) errs1 ++ errs2 return (mode, flags' ++ leftover, warns) -- cgit v1.2.1