From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id A0240383AF67 for ; Thu, 20 Oct 2022 09:38:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A0240383AF67 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 04F07300089; Thu, 20 Oct 2022 09:38:20 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Cc: gdb-patches@sourceware.org Subject: [PATCH 31/40] sim/ppc: Initialize help variables Date: Thu, 20 Oct 2022 09:32:36 +0000 Message-Id: <91681f1c5c0144e59196ec40e456f214cc74568d.1666258361.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Oct 2022 09:38:23 -0000 GCC / Clang generate a warning if a variables is used uninitialized on some cases. On the default configuration, it causes a build failure (unless "--disable-werror" is specified). This commit initializes two help variables with { 0 }. --- sim/ppc/hw_sem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/ppc/hw_sem.c b/sim/ppc/hw_sem.c index 937e2ad6f81..034191b10b7 100644 --- a/sim/ppc/hw_sem.c +++ b/sim/ppc/hw_sem.c @@ -109,7 +109,7 @@ hw_sem_init_data(device *me) hw_sem_device *sem = (hw_sem_device*)device_data(me); const device_unit *d; int status; - union semun help; + union semun help = { 0 }; /* initialize the properties of the sem */ @@ -188,7 +188,7 @@ hw_sem_io_read_buffer(device *me, struct sembuf sb; int status; uint32_t u32; - union semun help; + union semun help = { 0 }; /* do we need to worry about out of range addresses? */ -- 2.34.1