Commit 4952e802 authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov
Browse files

Add Werror to CC and HC (#309)

parent 3ea149ad
......@@ -8,7 +8,10 @@ ccBuilderArgs = builder Cc ? mconcat
, argSettingList . ConfCcArgs =<< getStage
, cIncludeArgs
, builder (Cc CompileC) ? mconcat [ arg "-c", arg =<< getInput
, builder (Cc CompileC) ? mconcat [ arg "-Werror"
-- mk/warning.mk:
-- SRC_CC_OPTS += -Wall $(WERROR)
, arg "-c", arg =<< getInput
, arg "-o", arg =<< getOutput ]
, builder (Cc FindCDependencies) ? do
......
......@@ -65,10 +65,24 @@ defaultArgs = mconcat
, sourceArgs defaultSourceArgs
, defaultPackageArgs ]
-- | Default flags about Werror
-- | mk/warnings.mk
defaultErrorGhcFlags :: Args
defaultErrorGhcFlags =
mconcat [ notStage0 ? arg "-Werror"
, (not <$> flag GccIsClang) ? mconcat [
(not <$> flag GccLt46) ? (not <$> windowsHost) ?
arg "-Werror=unused-but-set-variable"
, (not <$> flag GccLt44) ? arg "-Wno-error=inline" ]
, flag GccIsClang ? arg "-Wno-unknown-pragmas" ]
-- | Default source arguments, e.g. optimisation settings.
defaultSourceArgs :: SourceArgs
defaultSourceArgs = SourceArgs
{ hsDefault = mconcat [stage0 ? arg "-O", notStage0 ? arg "-O2", arg "-H32m"]
{ hsDefault = mconcat [ stage0 ? arg "-O"
, notStage0 ? arg "-O2"
, arg "-H32m"
, defaultErrorGhcFlags ]
, hsLibrary = mempty
, hsCompiler = mempty
, hsGhc = mempty }
......
......@@ -10,4 +10,5 @@ ghcPrimPackageArgs = package ghcPrim ? mconcat
, builder (Cc CompileC) ?
(not <$> flag GccLt44) ?
(not <$> flag GccIsClang) ?
input "//cbits/atomic.c" ? arg "-Wno-sync-nand" ]
......@@ -89,7 +89,9 @@ rtsPackageArgs = package rts ? do
, inputs ["//Evac.c", "//Evac_thr.c"] ? arg "-funroll-loops"
, inputs ["//Evac_thr.c", "//Scav_thr.c"] ?
append [ "-DPARALLEL_GC", "-Irts/sm" ] ]
append [ "-DPARALLEL_GC", "-Irts/sm" ]
, input "//StgCRun.c" ? windowsHost ? arg "-Wno-return-local-addr" ]
, builder Ghc ? arg "-Irts"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment