From: Heinrich Schuchardt Date: Sun, 31 Jul 2022 08:06:13 +0000 (+0200) Subject: Makefile: avoid false positive -Wmaybe-uninitialized X-Git-Tag: v2025.01-rc5-pxa1908~1316^2~3 X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=8602d97ca2cf3e06387251afddc281d1d1841f50;p=u-boot.git Makefile: avoid false positive -Wmaybe-uninitialized When compiling with -Og gcc reports false positive -Wmaybe-uninitialized as reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394. Silence these warnings when building with CONFIG_CC_OPTIMIZE_FOR_DEBUG. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- diff --git a/Makefile b/Makefile index df0d64b830..1a66f69a4b 100644 --- a/Makefile +++ b/Makefile @@ -676,6 +676,9 @@ endif # $(dot-config) ifdef CONFIG_CC_OPTIMIZE_FOR_DEBUG KBUILD_HOSTCFLAGS := -Wall -Wstrict-prototypes -Og -g -fomit-frame-pointer \ $(HOST_LFS_CFLAGS) $(HOSTCFLAGS) +# Avoid false positives -Wmaybe-uninitialized +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394 +KBUILD_HOSTCFLAGS += -Wno-maybe-uninitialized KBUILD_HOSTCXXFLAGS := -Og -g $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) endif @@ -696,7 +699,10 @@ KBUILD_CFLAGS += -O2 endif ifdef CONFIG_CC_OPTIMIZE_FOR_DEBUG -KBUILD_CFLAGS += -Og +KBUILD_CFLAGS += -Og -Wno-maybe-uninitialized +# Avoid false positives -Wmaybe-uninitialized +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78394 +KBUILD_CFLAGS += -Wno-maybe-uninitialized endif LTO_CFLAGS :=