[PATCH 1/1] 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 heinrich.schuchardt@canonical.com --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index ff25f92974..e6c9ced399 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 :=

On Sun, 31 Jul 2022 at 02:06, Heinrich Schuchardt heinrich.schuchardt@canonical.com wrote:
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 heinrich.schuchardt@canonical.com
Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Sun, Jul 31, 2022 at 10:06:13AM +0200, Heinrich Schuchardt wrote:
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 heinrich.schuchardt@canonical.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Heinrich Schuchardt
-
Simon Glass
-
Tom Rini