summaryrefslogtreecommitdiff
path: root/Makefile.toolchain
diff options
context:
space:
mode:
authorMichał Barnaś <mb@semihalf.com>2021-11-05 18:59:19 +0100
committerCommit Bot <commit-bot@chromium.org>2021-11-12 12:09:01 +0000
commit132f6bbe6c93374efe408f64d09132d51d3dc69d (patch)
treea98e1db4db88749a1828d0ae4fdbf6a71a103170 /Makefile.toolchain
parentc31b47cde029a18873b5147be1a4bbfb837bfbc1 (diff)
downloadchrome-ec-132f6bbe6c93374efe408f64d09132d51d3dc69d.tar.gz
build: add option to disable -Werror flag
This commit adds possibility to disable treating warnings as errors. In CrOS EC, define NO_ERRORS=1 as make parameter. In Zephyr, use --no-errors flag when configuring using zmake. BRANCH=main BUG=b:197888003 TEST=Add unused static function. Build without flags, compilation should fail. Build with no-errors flags, only warning should be visible. Change-Id: I7f873b7530317b74ff2865f420c4c248b4a95360 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3264191 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'Makefile.toolchain')
-rw-r--r--Makefile.toolchain6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile.toolchain b/Makefile.toolchain
index a79f248ea2..a56193201a 100644
--- a/Makefile.toolchain
+++ b/Makefile.toolchain
@@ -59,15 +59,19 @@ GCOV=$(CROSS_COMPILE)gcov
HOSTGCOV=$(CURDIR)/util/llvm-gcov.sh
C_WARN = -Wstrict-prototypes -Wdeclaration-after-statement -Wno-pointer-sign
-COMMON_WARN = -Wall -Wundef -Werror -Werror-implicit-function-declaration \
+COMMON_WARN = -Wall -Wundef -Werror-implicit-function-declaration \
-Wno-trigraphs -Wno-format-security -Wno-address-of-packed-member \
-fno-common -fno-strict-aliasing -fno-strict-overflow
+
+ifndef ALLOW_WARNINGS
+COMMON_WARN+=-Werror
ifeq ($(cc-name),clang)
COMMON_WARN+=-Werror=uninitialized
endif
ifeq ($(cc-name),gcc)
COMMON_WARN+=-Werror=maybe-uninitialized
endif
+endif
ifeq ($(cc-name),clang)
# TODO(b/172020503): Re-enabling this warning requires a large CL.