Message ID | 021dbd238af5dfe74523ed229d2156a155a6bb9e.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 AD2F1384B838 for <patchwork@sourceware.org>; Thu, 20 Oct 2022 09:37:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD2F1384B838 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258628; bh=6MbyPSDWyccNdQGOpn8PqXl6YuGySOgOqdD4aX9G714=; 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=VsPPzrQfi/lo5TreVNgMewC1+h4kl05aismvt3kh/DDUZYiJjwj5MOPcfaP3wGi2a pzZRlfwNKt8pCj8GhiE3wJyBG5MRGJsHyaljb7qIUqm9vKxJeKDtdePxrB0OA7skGM J+xyc8ahF8r9h3cspwwGLuZsuytVNDsjgjAd72X4= 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 CAD5E394260D for <gdb-patches@sourceware.org>; Thu, 20 Oct 2022 09:35:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CAD5E394260D Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 216DB300089; Thu, 20 Oct 2022 09:35:00 +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 12/40] sim/frv: Initialize nesr variable Date: Thu, 20 Oct 2022 09:32:17 +0000 Message-Id: <021dbd238af5dfe74523ed229d2156a155a6bb9e.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 generates a warning if a variable may be used uninitialized on some cases ("-Wmaybe-uninitialized"). Despite that GCC will not cause a build failure even when "--enable-werror" is specified, it would be nice to get rid of it. This commit initializes the variable nesr when declared. --- sim/frv/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 20 Oct 2022 09:32, Tsukasa OI wrote: > GCC generates a warning if a variable may be used uninitialized on some > cases ("-Wmaybe-uninitialized"). Despite that GCC will not cause a build > failure even when "--enable-werror" is specified, it would be nice to get > rid of it. > > This commit initializes the variable nesr when declared. afaict, the code as written is not using nesr uninitialized (well, it does, but not in a way that changes behavior in the func, or is exposed out). so this looks fine because setting it to 0 initially in those cases also does not change behavior. i'm not familiar enough with FRV to say if pulling nesr from a diff place would be more safe to future code refactors. but since this port seems to largely be stable at this point, this is probably fine. -mike
diff --git a/sim/frv/traps.c b/sim/frv/traps.c index 0c9eacd0bfd..b142c7890ad 100644 --- a/sim/frv/traps.c +++ b/sim/frv/traps.c @@ -432,7 +432,7 @@ frvbf_check_non_excepting_load ( int do_elos; SI NE_flags[2]; SI NE_base; - SI nesr; + SI nesr = 0; SI ne_index; FRV_REGISTER_CONTROL *control;