
#12056: Too aggressive `-w` option -------------------------------------+------------------------------------- Reporter: asr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #11429, #11789 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by wozgonon): Right enough, I understand a little better now, though the error originates from DynFlags.hs:3022. See '''JB111''' inserted into the code and in the output below. Just a thought: would changing '-Wunrecognised-warning-flags' to '-unrecognised-warning-flags' do anything to solve the problem? {{{ -- | This is where we handle unrecognised warning flags. We only issue a warning -- if -Wunrecognised-warning-flags is set. See Trac #11429 for context. unrecognisedWarning :: String -> Flag (CmdLineP DynFlags) unrecognisedWarning prefix = defFlag prefix (Prefix action) where action :: String -> EwM (CmdLineP DynFlags) () action flag = do f <- wopt Opt_WarnUnrecognisedWarningFlags <$> liftEwM getCmdLineState when f $ addWarn $ "JB111 unrecognised warning flag: -" ++ prefix ++ flag }}} {{{ ghc -wfoo -wbar -sfoo -sbar -Sfoo -Wfoo -Wbar -Wa -Wb -Wc on the commandline: warning: JB111 unrecognised warning flag: -Wfoo on the commandline: warning: JB111 unrecognised warning flag: -Wbar on the commandline: warning: JB111 unrecognised warning flag: -Wa on the commandline: warning: JB111 unrecognised warning flag: -Wb on the commandline: warning: JB111 unrecognised warning flag: -Wc ghc.exe: unrecognised flag: -wfoo unrecognised flag: -wbar unrecognised flag: -sfoo unrecognised flag: -sbar unrecognised flag: -Sfoo }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12056#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler