X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=ad327bda0fcd631b1c7907e46669369d574c1d8d;hp=f40ac43be3c75e7361857d40341afb0d3886732d;hb=cae75f82226638691cfa1e85fc168f4b65ddce4d;hpb=53ec704b7155b18a49f09e6894fd033db3b8f592 diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index f40ac43..ad327bd 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -83,7 +83,7 @@ import Control.Monad ( when ) import Data.Char import System.FilePath -import System.IO ( hPutStrLn, stderr ) +import System.IO ( stderr, hPutChar ) -- ----------------------------------------------------------------------------- -- DynFlags @@ -169,11 +169,12 @@ data DynFlag | Opt_WarnUnusedBinds | Opt_WarnUnusedImports | Opt_WarnUnusedMatches - | Opt_WarnDeprecations + | Opt_WarnWarningsDeprecations | Opt_WarnDeprecatedFlags | Opt_WarnDodgyImports | Opt_WarnOrphans | Opt_WarnTabs + | Opt_WarnDodgyForeignImports -- language opts | Opt_OverlappingInstances @@ -221,6 +222,7 @@ data DynFlag | Opt_TransformListComp | Opt_GeneralizedNewtypeDeriving | Opt_RecursiveDo + | Opt_PostfixOperators | Opt_PatternGuards | Opt_LiberalTypeSynonyms | Opt_Rank2Types @@ -593,9 +595,14 @@ defaultDynFlags = log_action = \severity srcSpan style msg -> case severity of - SevInfo -> hPutStrLn stderr (show (msg style)) - SevFatal -> hPutStrLn stderr (show (msg style)) - _ -> hPutStrLn stderr ('\n':show ((mkLocMessage srcSpan msg) style)) + SevInfo -> printErrs (msg style) + SevFatal -> printErrs (msg style) + _ -> do + hPutChar stderr '\n' + printErrs ((mkLocMessage srcSpan msg) style) + -- careful (#2302): printErrs prints in UTF-8, whereas + -- converting to string first and using hPutStr would + -- just emit the low 8 bits of each unicode char. } {- @@ -749,12 +756,13 @@ optLevelFlags standardWarnings :: [DynFlag] standardWarnings - = [ Opt_WarnDeprecations, + = [ Opt_WarnWarningsDeprecations, Opt_WarnDeprecatedFlags, Opt_WarnOverlappingPatterns, Opt_WarnMissingFields, Opt_WarnMissingMethods, - Opt_WarnDuplicateExports + Opt_WarnDuplicateExports, + Opt_WarnDodgyForeignImports ] minusWOpts :: [DynFlag] @@ -1381,6 +1389,7 @@ deprecatedForLanguage lang turnOn = fFlags :: [(String, DynFlag, Bool -> Deprecated)] fFlags = [ + ( "warn-dodgy-foreign-imports", Opt_WarnDodgyForeignImports, const Supported ), ( "warn-dodgy-imports", Opt_WarnDodgyImports, const Supported ), ( "warn-duplicate-exports", Opt_WarnDuplicateExports, const Supported ), ( "warn-hi-shadowing", Opt_WarnHiShadows, const Supported ), @@ -1398,7 +1407,7 @@ fFlags = [ ( "warn-unused-binds", Opt_WarnUnusedBinds, const Supported ), ( "warn-unused-imports", Opt_WarnUnusedImports, const Supported ), ( "warn-unused-matches", Opt_WarnUnusedMatches, const Supported ), - ( "warn-deprecations", Opt_WarnDeprecations, const Supported ), + ( "warn-warnings-deprecations", Opt_WarnWarningsDeprecations, const Supported ), ( "warn-deprecated-flags", Opt_WarnDeprecatedFlags, const Supported ), ( "warn-orphans", Opt_WarnOrphans, const Supported ), ( "warn-tabs", Opt_WarnTabs, const Supported ), @@ -1480,6 +1489,7 @@ languageOptions = [ dynFlag | (_, dynFlag, _) <- xFlags ] xFlags :: [(String, DynFlag, Bool -> Deprecated)] xFlags = [ ( "CPP", Opt_Cpp, const Supported ), + ( "PostfixOperators", Opt_PostfixOperators, const Supported ), ( "PatternGuards", Opt_PatternGuards, const Supported ), ( "UnicodeSyntax", Opt_UnicodeSyntax, const Supported ), ( "MagicHash", Opt_MagicHash, const Supported ), @@ -1567,6 +1577,7 @@ glasgowExtsFlags = [ , Opt_PolymorphicComponents , Opt_ExistentialQuantification , Opt_UnicodeSyntax + , Opt_PostfixOperators , Opt_PatternGuards , Opt_LiberalTypeSynonyms , Opt_RankNTypes @@ -1898,7 +1909,6 @@ machdepCCOpts _dflags sta = opt_Static in ( [ if sta then "-DDONT_WANT_WIN32_DLL_SUPPORT" else "" --- , if "mingw32" `isSuffixOf` cTARGETPLATFORM then "-mno-cygwin" else "" ], [ "-fno-defer-pop", "-fomit-frame-pointer",