From 78bd2710a7013884a0b71206ac99d2c6100de3bc Mon Sep 17 00:00:00 2001 From: Elyes Haouas Date: Mon, 3 Jun 2024 16:42:44 +0200 Subject: util/xcompile: Use new GCC's warning options only if supported Wflex-array-member-not-at-end & Wcalloc-transposed-args are not supported when using GCC older than GCC-14. Use them only when supported. Change-Id: I11c1e729569c8130bd254a10454c5066a72974d6 Signed-off-by: Elyes Haouas Reviewed-on: https://review.coreboot.org/c/coreboot/+/82785 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/xcompile/xcompile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile index ad4361db53..ff067d2f6a 100755 --- a/util/xcompile/xcompile +++ b/util/xcompile/xcompile @@ -201,6 +201,13 @@ detect_special_flags() { CFLAGS_GCC="$CFLAGS_GCC -Wno-address-of-packed-member" testcc "$GCC" "$CFLAGS_GCC --param=min-pagesize=1024 $FLAGS_GCC" && CFLAGS_GCC="$CFLAGS_GCC --param=min-pagesize=1024" + + testcc "$GCC" "$CFLAGS_GCC -Wflex-array-member-not-at-end" && + CFLAGS_GCC="$CFLAGS_GCC -Wflex-array-member-not-at-end" + + testcc "$GCC" "$CFLAGS_GCC -Wcalloc-transposed-args" && + CFLAGS_GCC="$CFLAGS_GCC -Wcalloc-transposed-args" + case "$architecture" in x86) ;; -- cgit v1.2.3