Skip to content

Commit

Permalink
Merge pull request #8258 from ffaf1/wall-werr-w
Browse files Browse the repository at this point in the history
Simplify -Werror warning
  • Loading branch information
mergify[bot] authored Jul 1, 2022
2 parents 1da1893 + 67ad6f6 commit be363be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions Cabal/src/Distribution/PackageDescription/Check.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1574,14 +1574,7 @@ checkDevelopmentOnlyFlagsOptions :: String -> [String] -> [PackageCheck]
checkDevelopmentOnlyFlagsOptions fieldName ghcOptions =
catMaybes [

check has_WerrorWall $
PackageDistInexcusable $
"'" ++ fieldName ++ ": -Wall -Werror' makes the package very easy to "
++ "break with future GHC versions because new GHC versions often "
++ "add new warnings. Use just '" ++ fieldName ++ ": -Wall' instead."
++ extraExplanation

, check (not has_WerrorWall && has_Werror) $
check (has_Werror) $
PackageDistInexcusable $
"'" ++ fieldName ++ ": -Werror' makes the package easy to "
++ "break with future GHC versions because new GHC versions often "
Expand Down Expand Up @@ -1627,10 +1620,7 @@ checkDevelopmentOnlyFlagsOptions fieldName ghcOptions =
++ "on a Cabal configuration flag (with 'manual: True' and 'default: "
++ "False') and enable that flag during development."

has_WerrorWall = has_Werror && ( has_Wall || has_W )
has_Werror = "-Werror" `elem` ghcOptions
has_Wall = "-Wall" `elem` ghcOptions
has_W = "-W" `elem` ghcOptions
has_J = any
(\o -> case o of
"-j" -> True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Warning: 'ghc-shared-options: -hide-package' is never needed. Cabal hides all pa
Warning: The following errors will cause portability problems on other environments:
Warning: 'ghc-options: -fasm' is unnecessary and will not work on CPU architectures other than x86, x86-64, ppc or sparc.
Warning: 'ghc-prof-options: -fhpc' is not necessary. Use the configure flag --enable-coverage instead.
Warning: 'ghc-shared-options: -Wall -Werror' makes the package very easy to break with future GHC versions because new GHC versions often add new warnings. Use just 'ghc-shared-options: -Wall' instead. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development.
Warning: 'ghc-shared-options: -Werror' makes the package easy to break with future GHC versions because new GHC versions often add new warnings. Alternatively, if you want to use this, make it conditional based on a Cabal configuration flag (with 'manual: True' and 'default: False') and enable that flag during development.
Warning: Hackage would reject this package.

0 comments on commit be363be

Please sign in to comment.