summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 52da3005bf..62fa936bff 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -2935,14 +2935,16 @@ dynamic_flags_deps = [
wWarningFlagsDeps
++ map (mkFlag turnOff "fno-warn-" unSetWarningFlag . hideFlag)
wWarningFlagsDeps
+ ++ [ (NotDeprecated, unrecognisedWarning "W")
+ , (NotDeprecated, unrecognisedWarning "fwarn-")
+ , (NotDeprecated, unrecognisedWarning "fno-warn-") ]
++ map (mkFlag turnOn "f" setExtensionFlag ) fLangFlagsDeps
++ map (mkFlag turnOff "fno-" unSetExtensionFlag) fLangFlagsDeps
++ map (mkFlag turnOn "X" setExtensionFlag ) xFlagsDeps
++ map (mkFlag turnOff "XNo" unSetExtensionFlag) xFlagsDeps
++ map (mkFlag turnOn "X" setLanguage ) languageFlagsDeps
++ map (mkFlag turnOn "X" setSafeHaskell ) safeHaskellFlagsDeps
- ++ [ (NotDeprecated, unrecognisedWarning)
- , make_dep_flag defFlag "XGenerics"
+ ++ [ make_dep_flag defFlag "XGenerics"
(NoArg $ return ())
("it does nothing; look into -XDefaultSignatures " ++
"and -XDeriveGeneric for generic programming support.")
@@ -2953,13 +2955,13 @@ dynamic_flags_deps = [
-- | 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 :: Flag (CmdLineP DynFlags)
-unrecognisedWarning = defFlag "W" (Prefix action)
+unrecognisedWarning :: String -> Flag (CmdLineP DynFlags)
+unrecognisedWarning pfx = defFlag pfx (Prefix action)
where
action :: String -> EwM (CmdLineP DynFlags) ()
action flag = do
f <- wopt Opt_WarnUnrecognisedWarningFlags <$> liftEwM getCmdLineState
- when f $ addWarn $ "unrecognised warning flag: -W" ++ flag
+ when f $ addWarn $ "unrecognised warning flag: -" ++ pfx ++ flag
-- See Note [Supporting CLI completion]
package_flags_deps :: [(Deprecation, Flag (CmdLineP DynFlags))]