public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] sim: Initialize pbb_br_* by default
Date: Tue, 11 Oct 2022 14:19:36 +0000 (GMT)	[thread overview]
Message-ID: <20221011141936.F312C3858403@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=babcfd75883790c13de37c86f15de7d4bca582de

commit babcfd75883790c13de37c86f15de7d4bca582de
Author: Tsukasa OI <research_trasio@irq.a4lg.com>
Date:   Thu Oct 6 06:43:53 2022 +0000

    sim: Initialize pbb_br_* by default
    
    On the files generated by sim/common/genmloop.sh, variables pbb_br_type and
    pbb_br_npc are declared uninitialized and passed to other functions in some
    cases.  Despite that those are harmless, they will generate GCC warnings
    ("-Wmaybe-uninitialized").
    
    This commit ensures that pbb_br_type and pbb_br_npc variables are
    initialized to a harmless value.

Diff:
---
 sim/common/genmloop.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index 1bbeb615b05..5f6456d7159 100755
--- a/sim/common/genmloop.sh
+++ b/sim/common/genmloop.sh
@@ -1167,8 +1167,8 @@ void
   SEM_PC vpc;
 #if WITH_SEM_SWITCH_FULL
   /* For communication between cti's and cti-chain.  */
-  SEM_BRANCH_TYPE pbb_br_type;
-  PCADDR pbb_br_npc;
+  SEM_BRANCH_TYPE pbb_br_type = SEM_BRANCH_UNTAKEN;
+  PCADDR pbb_br_npc = 0;
 #endif
 
 EOF
@@ -1259,8 +1259,8 @@ void
   SEM_PC vpc;
 #if WITH_SEM_SWITCH_FAST
   /* For communication between cti's and cti-chain.  */
-  SEM_BRANCH_TYPE pbb_br_type;
-  PCADDR pbb_br_npc;
+  SEM_BRANCH_TYPE pbb_br_type = SEM_BRANCH_UNTAKEN;
+  PCADDR pbb_br_npc = 0;
 #endif
 
 EOF

                 reply	other threads:[~2022-10-11 14:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20221011141936.F312C3858403@sourceware.org \
    --to=aburgess@sourceware.org \
    --cc=gdb-cvs@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).