public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@linaro.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] [sim,rx] Silence warning that turns into a build error
Date: Thu,  8 Apr 2021 16:51:43 -0300	[thread overview]
Message-ID: <20210408195143.1349459-1-luis.machado@linaro.org> (raw)

On a 32-bit build, I ran into the following:

sim/rx/fpu.c:789:6: error: ‘*((void *)&a+8)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
rv = fp_implode (&a);

To silence this, just initialize the struct with 0's.

sim/rx/ChangeLog:

YYYY-MM-DD  Luis Machado  <luis.machado@linaro.org>

	* fpu.c (rxfp_itof): Initialize structure.
---
 sim/rx/fpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sim/rx/fpu.c b/sim/rx/fpu.c
index f9e9007192a..9c789e8518c 100644
--- a/sim/rx/fpu.c
+++ b/sim/rx/fpu.c
@@ -732,7 +732,7 @@ rxfp_itof (long fa, int round_mode)
   int sign = 0;
   unsigned int frac_bits;
   volatile unsigned int whole_bits;
-  FP_Parts a;
+  FP_Parts a = {0, 0, 0, 0, 0};
 
   if (fa == 0)
     return PLUS_ZERO;
-- 
2.25.1


             reply	other threads:[~2021-04-08 19:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 19:51 Luis Machado [this message]
2021-04-08 20:16 ` Mike Frysinger
2021-04-08 20:23   ` Luis Machado
2021-04-08 20:25     ` Luis Machado
2021-04-08 20:57     ` Mike Frysinger
2021-04-09 12:17       ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408195143.1349459-1-luis.machado@linaro.org \
    --to=luis.machado@linaro.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).