Message ID | 91681f1c5c0144e59196ec40e456f214cc74568d.1666258361.git.research_trasio@irq.a4lg.com |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C935F394C836 for <patchwork@sourceware.org>; Thu, 20 Oct 2022 09:40:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C935F394C836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258859; bh=5T9786hv/pye271HKZf0ZVyUUQfszErpXTZx3GN8mQs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=SVXHLC76lZaMEinaGnfsVM95j5Vno2+3cxLv++K+qM14aJTbow/TA/nVao1I0munb Lii71FMT8pMjkzISs6oLwpEjb9yvysbqvA7rwaLLTqY3N5MpZaNfaU80r1EvXqqz+E 2GNWeZT2KCTOsOTcBn6xaGVw4hQYVl4Ze4jeZ10w= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id A0240383AF67 for <gdb-patches@sourceware.org>; 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) To: Tsukasa OI <research_trasio@irq.a4lg.com>, Andrew Burgess <aburgess@redhat.com>, Mike Frysinger <vapier@gentoo.org>, Nick Clifton <nickc@redhat.com> 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: <cover.1666258361.git.research_trasio@irq.a4lg.com> References: <cover.1666258361.git.research_trasio@irq.a4lg.com> 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tsukasa OI via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tsukasa OI <research_trasio@irq.a4lg.com> Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
sim+gdb: Suppress warnings if built with Clang (big batch 1)
|
|
Commit Message
Tsukasa OI
Oct. 20, 2022, 9:32 a.m. UTC
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(-)
Comments
Andrew posted a diff fix that i think we should use instead -mike
Tsukasa OI <research_trasio@irq.a4lg.com> writes: > 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 }. I've not pushed my fix as I'd like to reach consensus before merging anything. But I agree with Mike here, initializing help here just so that it can be used somewhere it's not needed seems like the wrong solution. Thanks, Andrew > --- > 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
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? */