summaryrefslogtreecommitdiff
path: root/util/xcompile
diff options
context:
space:
mode:
authorFelix Singer <felixsinger@posteo.net>2024-07-03 16:04:19 +0200
committerFelix Singer <felixsinger@posteo.net>2024-08-01 20:22:53 +0000
commit17968caa94aa345affcc14e6f6db2605d31535e3 (patch)
tree59191c43de152381707d5a9d5bfda1701e75f3ad /util/xcompile
parent0dba005f04c1e285e7745a9e3a16ef068563e3ee (diff)
xcompile: Apply -Wextra with temporary exceptions to GCC
In order to detect more issues in our code, make GCC more picky by enabling -Wextra. Disable a couple of warnings turned on by -Wextra temporarily in order to keep everything compiling and working for now. The warnings may be enabled step by step later. Since xcompiles applies to coreboot and libpayload, add Wextra here instead of the top-level Makefile.mk. Change-Id: I60915cb66581dc2c9b6807335fd0e214b45e76d6 Signed-off-by: Felix Singer <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83347 Reviewed-by: Martin L Roth <gaumless@gmail.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'util/xcompile')
-rwxr-xr-xutil/xcompile/xcompile33
1 files changed, 33 insertions, 0 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index b3012b5eca..4ead648305 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -208,6 +208,39 @@ detect_special_flags() {
testcc "$GCC" "$CFLAGS_GCC -Wcalloc-transposed-args" &&
CFLAGS_GCC="$CFLAGS_GCC -Wcalloc-transposed-args"
+ testcc "$GCC" "$CFLAGS_GCC -Wno-unused-parameter" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-unused-parameter"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-sign-compare" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-sign-compare"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-empty-body" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-empty-body"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-missing-field-initializers" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-missing-field-initializers"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-override-init" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-override-init"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-ignored-qualifiers" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-ignored-qualifiers"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-shift-negative-value" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-shift-negative-value"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-unused-but-set-parameter" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-unused-but-set-parameter"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-type-limits" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-type-limits"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wno-cast-function-type" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wno-cast-function-type"
+
+ testcc "$GCC" "$CFLAGS_GCC -Wextra" &&
+ CFLAGS_GCC="$CFLAGS_GCC -Wextra"
+
case "$architecture" in
x86)
;;