From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uN/OOR8XUWNYsA4AWB0awg (envelope-from ) for ; Thu, 20 Oct 2022 05:38:39 -0400 Received: by simark.ca (Postfix, from userid 112) id EA87F1E112; Thu, 20 Oct 2022 05:38:39 -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=gnGznYZg; 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 A73511E0D5 for ; Thu, 20 Oct 2022 05:38:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 993183889EA3 for ; Thu, 20 Oct 2022 09:37:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 993183889EA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666258639; bh=3LWhfDVBPd2V2FXhMsRF5720kZSZz2r3g09vC5t6G/o=; 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=gnGznYZgeMK8FkcOkbKzfz5IS3lJVVGxWBnVc3tMESZJlTEFKPkLx7AQ2+0omfzx9 oP2L3FDRehtOoxvB1C0d3fS2gBnMehf0LTUfHBoGzpn9WStyp3Y2ex2YO73G+g3cGr khQ3hReaXCbmhNOi51+CbKIpZYtAdd/NaQqaHjQE= Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 77399395BC29 for ; Thu, 20 Oct 2022 09:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 77399395BC29 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id C9A85300089; Thu, 20 Oct 2022 09:36:13 +0000 (UTC) To: Tsukasa OI , Andrew Burgess , Mike Frysinger , Nick Clifton Subject: [PATCH 19/40] sim/m32r: Initialize "list" variable Date: Thu, 20 Oct 2022 09:32:24 +0000 Message-Id: <6559cc9db4127924fbd8a753b6674c72f466ca24.1666258361.git.research_trasio@irq.a4lg.com> 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" The variable "list" is only initialized when arg1 > 0 and when arg1 == 0, an uninitialized value is passed to translate_endian_h2t function. Although this behavior is harmless, this commit adds initialization to avoid a GCC warning ("-Wmaybe-uninitialized"). --- sim/m32r/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/m32r/traps.c b/sim/m32r/traps.c index 267d54881da..12a87b4a697 100644 --- a/sim/m32r/traps.c +++ b/sim/m32r/traps.c @@ -547,7 +547,7 @@ m32r_trap (SIM_CPU *current_cpu, PCADDR pc, int num) case TARGET_LINUX_SYS_getgroups32: case TARGET_LINUX_SYS_getgroups: { - gid_t *list; + gid_t *list = NULL; if (arg1 > 0) list = (gid_t *) malloc (arg1 * sizeof(gid_t)); -- 2.34.1