Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89792600 authored by Chenglu Lin's avatar Chenglu Lin Committed by dianlujitao
Browse files

kernel: Add CC_WERROR config to turn warnings into errors



Add configuration option CONFIG_CC_WERROR to prevent warnings
from creeping in.

Bug: 141372918
Change-Id: Ie2d067c0177d8f13e9aaa9a78867998e390f89ee
Signed-off-by: default avatarChenglu Lin <chenglulin@google.com>
parent ede19bd3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -702,6 +702,10 @@ else
KBUILD_CFLAGS   += -O2
endif

ifdef CONFIG_CC_WERROR
KBUILD_CFLAGS  += -Werror
endif

# Tell gcc to never replace conditional load with a non-conditional one
KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
KBUILD_CFLAGS	+= $(call cc-option,-fno-allow-store-data-races)
+10 −0
Original line number Diff line number Diff line
@@ -2118,6 +2118,16 @@ config PANIC_ON_DATA_CORRUPTION
	 recoverable data corruption scenarios to system-halting panics,
	 for easier detection and debug.

config CC_WERROR
	bool "Treat all compile warnings as errors"
	default n
	help
	 Select this option to set compiler warnings as errors,
	 to prevent easily-fixable problems from creeping into
	 the codebase.

	 If unsure, say N.

source "samples/Kconfig"

source "lib/Kconfig.kgdb"