From 60a0c2ed87883e6ee97bee42d3e8127a1fb27409 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 20 Feb 2023 22:36:02 +0800 Subject: [PATCH] tools/ci: skip -Warray-bounds check due to bug of GCC-12.2 Wrong warning array subscript [0] is outside array bounds: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 Signed-off-by: chao an --- arch/arm/src/common/Toolchain.defs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/src/common/Toolchain.defs b/arch/arm/src/common/Toolchain.defs index 4488ebd418b..099777f56bc 100644 --- a/arch/arm/src/common/Toolchain.defs +++ b/arch/arm/src/common/Toolchain.defs @@ -227,6 +227,17 @@ else ARCHOPTIMIZATION += -fno-builtin endif endif + + # Workaround to skip -Warray-bounds check due to bug of GCC-12.2: + # Wrong warning array subscript [0] is outside array bounds: + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523 + + GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/') + + ifeq ($(GCCVER),12.2.1) + ARCHOPTIMIZATION += --param=min-pagesize=0 + endif + endif # Zig compiler