From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id F312C3858403; Tue, 11 Oct 2022 14:19:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F312C3858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665497976; bh=H3ck3upPZWtLXqGgtD7OrNS4V2TMwf8jICH9LSkcvGM=; h=From:To:Subject:Date:From; b=RHZyIMWx0XqDvgLu79rEjdTrDc/EjAUYwdjX/M3zvl+HB0/NijYXZ9j/hBND85eLH oNv3Gh8FUtTCe5oGDwEpOn8FPI7InScsxVpjMFn/NIeGwnKplET+pzu6OwQkQE7VrR 17+foFDljdN3Qd3nxgNEMucO449y4UAYQYKWc4Vg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim: Initialize pbb_br_* by default X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: 340aa4f6872ca3c4f7fc4a79671537064d0ca91f X-Git-Newrev: babcfd75883790c13de37c86f15de7d4bca582de Message-Id: <20221011141936.F312C3858403@sourceware.org> Date: Tue, 11 Oct 2022 14:19:36 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dbabcfd758837= 90c13de37c86f15de7d4bca582de commit babcfd75883790c13de37c86f15de7d4bca582de Author: Tsukasa OI Date: Thu Oct 6 06:43:53 2022 +0000 sim: Initialize pbb_br_* by default =20 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"). =20 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 =3D SEM_BRANCH_UNTAKEN; + PCADDR pbb_br_npc =3D 0; #endif =20 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 =3D SEM_BRANCH_UNTAKEN; + PCADDR pbb_br_npc =3D 0; #endif =20 EOF