Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83306?usp=email )
Change subject: Makefile.mk: Move recently introduced warning options to xcompile ......................................................................
Makefile.mk: Move recently introduced warning options to xcompile
-Walloc-size was introduced with GCC 14 and -Wcast-function-type with GCC 8, which is still shipped by some distros with LTS support. In order to be backwards compatible to these GCC versions, move them to xcompile, which only applies them if the GCC version supports it.
Change-Id: Ibadcd22f99703ced700a1b671e7696255ecf9e71 Signed-off-by: Felix Singer felixsinger@posteo.net --- M Makefile.mk M util/xcompile/xcompile 2 files changed, 6 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/83306/1
diff --git a/Makefile.mk b/Makefile.mk index a16089d..1b658b5 100644 --- a/Makefile.mk +++ b/Makefile.mk @@ -528,8 +528,6 @@ CFLAGS_common += -Wstring-compare ifeq ($(CONFIG_COMPILER_GCC),y) CFLAGS_common += -Wold-style-declaration -CFLAGS_common += -Walloc-size -CFLAGS_common += -Wcast-function-type # Don't add these GCC specific flags when running scan-build ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),) CFLAGS_common += -Wno-packed-not-aligned diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index ff067d2..a7be0c7 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -208,6 +208,12 @@ testcc "$GCC" "$CFLAGS_GCC -Wcalloc-transposed-args" && CFLAGS_GCC="$CFLAGS_GCC -Wcalloc-transposed-args"
+ testcc "$GCC" "$CFLAGS_GCC -Walloc-size" && + CFLAGS_GCC="$CFLAGS_GCC -Walloc-size" + + testcc "$GCC" "$CFLAGS_GCC -Wcast-function-type" && + CFLAGS_GCC="$CFLAGS_GCC -Wcast-function-type" + case "$architecture" in x86) ;;