u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized
@ 2022-07-31  8:06 Heinrich Schuchardt
  2022-07-31 18:41 ` Simon Glass
  2022-08-10 21:50 ` Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Heinrich Schuchardt @ 2022-07-31  8:06 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, u-boot, Heinrich Schuchardt

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 :=
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized
  2022-07-31  8:06 [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized Heinrich Schuchardt
@ 2022-07-31 18:41 ` Simon Glass
  2022-08-10 21:50 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2022-07-31 18:41 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Tom Rini, U-Boot Mailing List

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized
  2022-07-31  8:06 [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized Heinrich Schuchardt
  2022-07-31 18:41 ` Simon Glass
@ 2022-08-10 21:50 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2022-08-10 21:50 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Simon Glass, u-boot

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

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!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-10 21:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-31  8:06 [PATCH 1/1] Makefile: avoid false positive -Wmaybe-uninitialized Heinrich Schuchardt
2022-07-31 18:41 ` Simon Glass
2022-08-10 21:50 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).