[commit: ghc] wip/nfs-locking: Disable some warnings (#307) (3ea149a)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:18:36 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/3ea149adad2311ea711bc58950e288d081fde79a/ghc

>---------------------------------------------------------------

commit 3ea149adad2311ea711bc58950e288d081fde79a
Author: Zhen Zhang <izgzhen at gmail.com>
Date:   Fri Apr 28 23:28:04 2017 +0800

    Disable some warnings (#307)


>---------------------------------------------------------------

3ea149adad2311ea711bc58950e288d081fde79a
 src/Settings/Default.hs | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/src/Settings/Default.hs b/src/Settings/Default.hs
index d242502..90e2db0 100644
--- a/src/Settings/Default.hs
+++ b/src/Settings/Default.hs
@@ -215,6 +215,43 @@ defaultBuilderArgs = mconcat
     , makeBuilderArgs
     , tarBuilderArgs ]
 
+-- | Disable some warnings in packages we use
+-- | https://github.com/ghc/ghc/blob/master/mk/warnings.mk#L46
+disableWarningArgsStage0 :: Args
+disableWarningArgsStage0 = stage Stage0 ? builder Ghc ? mconcat
+    [ package transformers ? append [ "-fno-warn-unused-matches", "-fno-warn-unused-imports" ]
+    , package terminfo ? append [ "-fno-warn-unused-imports" ] ]
+
+disableWarningArgsStage1 :: Args
+disableWarningArgsStage1 = notStage0 ? builder Ghc ? mconcat
+    [ package bytestring ? append [ "-Wno-inline-rule-shadowing" ]
+    , package haddock ? append [ "-Wno-unused-imports", "-Wno-deprecations" ]
+    , package directory ? append [ "-Wno-unused-imports" ]
+    , package binary ? append [ "-Wno-deprecations" ]
+    , package haskeline ? append [ "-Wno-deprecations", "-Wno-unused-imports",
+                                 "-Wno-redundant-constraints",
+                                 "-Wno-simplifiable-class-constraints" ]
+    , package pretty ? append [ "-Wno-unused-imports" ]
+    , package primitive ? append [ "-Wno-unused-imports", "-Wno-deprecations" ]
+    , package terminfo ? append [ "-Wno-unused-imports" ]
+    , package xhtml ? append [ "-Wno-unused-imports", "-Wno-tabs" ]
+    , package transformers ? append [ "-Wno-unused-matches", "-Wno-unused-imports",
+                                    "-Wno-redundant-constraints", "-Wno-orphans" ]
+    , package base ? append [ "-Wno-trustworthy-safe" ]
+    , package ghcPrim ? append [ "-Wno-trustworthy-safe" ]
+    , package win32 ? append [ "-Wno-trustworthy-safe" ] ]
+
+-- GhcLibExtraHcOpts += -Wno-deprecated-flags
+-- GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags
+disableWarningArgsLibs :: Args
+disableWarningArgsLibs = do
+  pkg <- getPackage
+  isLibrary pkg ? builder Ghc ? mconcat
+    [ notStage0 ? arg "-Wno-deprecated-flags"
+    , stage Stage0 ? arg "-fno-warn-deprecated-flags"]
+
+-- TODO: Disable warnings for Windows specifics
+
 -- | All 'Package'-dependent command line arguments.
 defaultPackageArgs :: Args
 defaultPackageArgs = mconcat
@@ -227,4 +264,7 @@ defaultPackageArgs = mconcat
     , haddockPackageArgs
     , integerGmpPackageArgs
     , rtsPackageArgs
-    , runGhcPackageArgs ]
+    , runGhcPackageArgs
+    , disableWarningArgsStage0
+    , disableWarningArgsStage1
+    , disableWarningArgsLibs ]



More information about the ghc-commits mailing list