]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: Add -Werror build option
authorSimon Que <sque@chromium.org>
Sat, 26 Jan 2013 01:29:16 +0000 (17:29 -0800)
committerChromeBot <chrome-bot@google.com>
Thu, 31 Jan 2013 19:09:02 +0000 (11:09 -0800)
Add a config option "ERROR_ON_WARNING" that adds the "-Werror" flag to
gcc, which turns warnings into errors.

BUG=chromium-os:5542
TEST=none

Change-Id: I8d85b8ba443585025a49618c3bca6d9bb7813359
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42075
Reviewed-by: Mandeep Singh Baines <msb@chromium.org>
Makefile
lib/Kconfig.debug

index a6879630a3eacdcc72f54d705cf366da4f87eddf..7502f5f154aed26d156d7af8919a594571b0dfca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -620,6 +620,10 @@ endif
 NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
 CHECKFLAGS     += $(NOSTDINC_FLAGS)
 
+ifdef CONFIG_ERROR_ON_WARNING
+KBUILD_CFLAGS += -Werror
+endif
+
 # warn about C99 declaration after statement
 KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
 
index 83b25580ae71413933ae20909cd1d9895e67f8e1..28005ff9a5cce19a9abc399addabe196e5824b84 100644 (file)
@@ -1305,3 +1305,12 @@ source "lib/Kconfig.kmemcheck"
 
 config TEST_KSTRTOX
        tristate "Test kstrto*() family of functions at runtime"
+
+config ERROR_ON_WARNING
+       bool "Treat compiler warnings as errors"
+       help
+         If you say Y here, the Makefile will pass the "-Werror" option to the
+         compiler.  This will cause the compiler to fail on any warning, as if
+         it were an error.
+
+         If unsure, say N.