import Data.Char
import System.FilePath
-import System.IO ( hPutStrLn, stderr )
+import System.IO ( stderr, hPutChar )
-- -----------------------------------------------------------------------------
-- DynFlags
| Opt_WarnUnusedBinds
| Opt_WarnUnusedImports
| Opt_WarnUnusedMatches
- | Opt_WarnDeprecations
+ | Opt_WarnWarningsDeprecations
| Opt_WarnDeprecatedFlags
| Opt_WarnDodgyImports
| Opt_WarnOrphans
| Opt_TransformListComp
| Opt_GeneralizedNewtypeDeriving
| Opt_RecursiveDo
+ | Opt_PostfixOperators
| Opt_PatternGuards
| Opt_LiberalTypeSynonyms
| Opt_Rank2Types
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.
}
{-
setHiDir f d = d{ hiDir = Just f}
setStubDir f d = d{ stubDir = Just f, includePaths = f : includePaths d }
-- -stubdir D adds an implicit -I D, so that gcc can find the _stub.h file
- -- #included from the .hc file when compiling with -fvia-C.
+ -- \#included from the .hc file when compiling with -fvia-C.
setObjectSuf f d = d{ objectSuf = f}
setHiSuf f d = d{ hiSuf = f}
standardWarnings :: [DynFlag]
standardWarnings
- = [ Opt_WarnDeprecations,
+ = [ Opt_WarnWarningsDeprecations,
Opt_WarnDeprecatedFlags,
Opt_WarnOverlappingPatterns,
Opt_WarnMissingFields,
( "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 ),
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 ),
, Opt_PolymorphicComponents
, Opt_ExistentialQuantification
, Opt_UnicodeSyntax
+ , Opt_PostfixOperators
, Opt_PatternGuards
, Opt_LiberalTypeSynonyms
, Opt_RankNTypes
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",