diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-16 13:32:32 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-16 14:45:00 +0100 |
commit | 437ebdda48e7a32fe1bea49cb503f456a0152a36 (patch) | |
tree | 0cf901e8b74b7644d6db8833070917efc5960565 /mk/warnings.mk | |
parent | 2206fa8cdb1209320f3690690b610320b4810de6 (diff) | |
download | haskell-437ebdda48e7a32fe1bea49cb503f456a0152a36.tar.gz |
Start using `-W` instead of `-f(no-)warn` in some places
This replaces some occurences of `-f(no-)warn` with the new `-W`-aliases
introduced via 2206fa8cdb120932 / #11218, in cases which are guaranteed
to be invoked with recent enough GHC (i.e. the stage1+ GHC).
After this commit, mostly the compiler and the testsuite remain using
`-f(wo-)warn...` because the compiler needs to be bootstrappable with
older GHCs, while for the testsuite it's convenient to be able to quickly
compare the behavior to older GHCs (which may not support the new flags yet).
The compiler-part can be updated to use the new flags once GHC 8.3 development
starts.
Reviewed By: quchen
Differential Revision: https://phabricator.haskell.org/D1637
Diffstat (limited to 'mk/warnings.mk')
-rw-r--r-- | mk/warnings.mk | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/mk/warnings.mk b/mk/warnings.mk index f8db8fd35d..dd7967383a 100644 --- a/mk/warnings.mk +++ b/mk/warnings.mk @@ -32,15 +32,20 @@ SRC_CC_WARNING_OPTS += -Wno-unknown-pragmas endif -SRC_HC_WARNING_OPTS_STAGE1 += -fwarn-noncanonical-monad-instances -SRC_HC_WARNING_OPTS_STAGE2 += -fwarn-noncanonical-monad-instances +SRC_HC_WARNING_OPTS_STAGE1 += -Wnoncanonical-monad-instances +SRC_HC_WARNING_OPTS_STAGE2 += -Wnoncanonical-monad-instances ###################################################################### # Disable some warnings in packages we use +# NB: The GHC version used for bootstrapping may not support the +# `-W`-aliases for `-f(no-)warn` flags introduced in GHC 8.0, so in +# some cases (watch out for make-variables with a name containing +# "boot") we need to pass the legacy `-f(no-)warn`-flags instead. + # Libraries that have dubious RULES -libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing +libraries/bytestring_dist-install_EXTRA_HC_OPTS += -Wno-inline-rule-shadowing # Cabal doesn't promise to be warning-free utils/ghc-cabal_dist_EXTRA_HC_OPTS += -w @@ -48,47 +53,47 @@ libraries/Cabal/Cabal_dist-boot_EXTRA_HC_OPTS += -w libraries/Cabal/Cabal_dist-install_EXTRA_HC_OPTS += -w # Turn off import warnings for bad unused imports -libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -libraries/bytestring_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-unused-imports -libraries/vector_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports +libraries/containers_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports +libraries/bytestring_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports +utils/haddock_dist_EXTRA_HC_OPTS += -Wno-unused-imports +libraries/vector_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports # haddock's attoparsec uses deprecated `inlinePerformIO` -utils/haddock_dist_EXTRA_HC_OPTS += -fno-warn-deprecations +utils/haddock_dist_EXTRA_HC_OPTS += -Wno-deprecations # containers uses bitSize at the moment -libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations -libraries/containers_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints +libraries/containers_dist-install_EXTRA_HC_OPTS += -Wno-deprecations +libraries/containers_dist-install_EXTRA_HC_OPTS += -Wno-redundant-constraints # On Windows, there are also some unused import warnings ifeq "$(HostOS_CPP)" "mingw32" -libraries/time_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -fno-warn-identities +libraries/time_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports -Wno-identities endif # haskeline has warnings about deprecated use of block/unblock -libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-deprecations -libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports -libraries/haskeline_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints +libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-deprecations +libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports +libraries/haskeline_dist-install_EXTRA_HC_OPTS += -Wno-redundant-constraints # binary upstream has some warnings, so don't use -Werror for it libraries/binary_dist-boot_EXTRA_HC_OPTS += -Wwarn libraries/binary_dist-install_EXTRA_HC_OPTS += -Wwarn # temporarily turn off unused-imports warnings for pretty -libraries/pretty_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports +libraries/pretty_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports # primitive has a warning about deprecated use of GHC.IOBase -libraries/primitive_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports +libraries/primitive_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports # temporarily turn off unused-imports warnings for terminfo libraries/terminfo_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-imports -libraries/terminfo_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports +libraries/terminfo_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports # vector has some unused match warnings libraries/vector_dist-install_EXTRA_HC_OPTS += -Wwarn # temporarily turn off unused-imports warnings for xhtml -libraries/xhtml_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-imports +libraries/xhtml_dist-install_EXTRA_HC_OPTS += -Wno-unused-imports libraries/dph/dph-base_dist-install_EXTRA_HC_OPTS += -Wwarn libraries/dph/dph-prim-interface_dist-install_EXTRA_HC_OPTS += -Wwarn @@ -98,16 +103,16 @@ libraries/dph/dph-lifted-common-install_EXTRA_HC_OPTS += -Wwarn # transformers has unused function parameters warnings libraries/transformers_dist-boot_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports -libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-unused-matches -fno-warn-unused-imports -libraries/transformers_dist-install_EXTRA_HC_OPTS += -fno-warn-redundant-constraints +libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wno-unused-matches -Wno-unused-imports +libraries/transformers_dist-install_EXTRA_HC_OPTS += -Wno-redundant-constraints # Turn of trustworthy-safe warning -libraries/base_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe -libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe -libraries/Win32_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe +libraries/base_dist-install_EXTRA_HC_OPTS += -Wno-trustworthy-safe +libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -Wno-trustworthy-safe +libraries/Win32_dist-install_EXTRA_HC_OPTS += -Wno-trustworthy-safe -# We need -fno-warn-deprecated-flags to avoid failure with -Werror -GhcLibExtraHcOpts += -fno-warn-deprecated-flags +# We need -Wno-deprecated-flags to avoid failure with -Werror +GhcLibExtraHcOpts += -Wno-deprecated-flags GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags # The warning suppression flag below is a temporary kludge. While working with @@ -116,7 +121,7 @@ GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags # http://ghc.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#TabsvsSpaces # for details # -GhcLibExtraHcOpts += -fno-warn-tabs +GhcLibExtraHcOpts += -Wno-tabs GhcBootLibExtraHcOpts += -fno-warn-tabs |