From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IP9cC9AXUWNqsQ4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 05:41:36 -0400 Received: by simark.ca (Postfix, from userid 112) id 2C5151E112; Thu, 20 Oct 2022 05:41:36 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=jRG2XxWt; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D71421E0D5 for ; Thu, 20 Oct 2022 05:41:35 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4B181383158D for ; Thu, 20 Oct 2022 09:41:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B181383158D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258889; bh=qxMaTBbIsACihTDkVrVAyaiE6f9F9Hd4Xhs3qaZJf48=; 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=jRG2XxWtOCRKWgkPnAGo5il3EzlxPZqMn+aEolb9udxvW/DVRzKmBCEs/sV235Fou kZFRKZcvArmFo/v3rSyuCHfGsZZo7GGt3L/VAtb/nc74xVNl6d5vXfkvA4207quHfr D3L5XJdN8m+82gIdM4UiVeB38CVJ/BCHwISo4Hsg= Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id BAAF53831D94 for ; Thu, 20 Oct 2022 09:38:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BAAF53831D94 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 100C1300089; Thu, 20 Oct 2022 09:38:41 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 33/40] sim/ppc: Initialize reg and control_nr Date: Thu, 20 Oct 2022 09:32:38 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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 variables "reg" and "control_nr" when declared. --- sim/ppc/hw_ide.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/ppc/hw_ide.c b/sim/ppc/hw_ide.c index af61eeccab6..b4ac8e99204 100644 --- a/sim/ppc/hw_ide.c +++ b/sim/ppc/hw_ide.c @@ -729,8 +729,8 @@ hw_ide_io_read_buffer(device *me, unsigned_word cia) { hw_ide_device *ide = (hw_ide_device *)device_data(me); - int control_nr; - int reg; + int control_nr = 0; + int reg = 0; ide_controller *controller; /* find the interface */ @@ -783,8 +783,8 @@ hw_ide_io_write_buffer(device *me, unsigned_word cia) { hw_ide_device *ide = (hw_ide_device *)device_data(me); - int control_nr; - int reg; + int control_nr = 0; + int reg = 0; ide_controller *controller; /* find the interface */ -- 2.34.1