From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7896) id B6FA23858D20; Sat, 29 Oct 2022 08:15:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6FA23858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667031322; bh=8eSPvZFYeRv3owL/T3EoU7DXgHbL85LMV7poil3Vs68=; h=From:To:Subject:Date:From; b=G+uM1Uhzv7q9HEkimoqEEb3UIYqo1ZJQtCuInyhzkA70iZoijG6FPzS1U5mPrcjis AfTmbBCBotqMPu4BtguYTCxvGNbuMDpcjFnalrdOBXMu3z6lriFxpTc43cuZTtPg0Q NCx6w0fklpIPTYbTAgWG4ZS3fL+N7V5Bl/oPSk4c= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tsukasa OI To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/m32r: Initialize "list" variable X-Act-Checkin: binutils-gdb X-Git-Author: Tsukasa OI X-Git-Refname: refs/heads/master X-Git-Oldrev: 57e3eee069a54ca09d89055bf6eccff710f87ed8 X-Git-Newrev: 45f8296e6965ff4e2ca855e995149add6352645d Message-Id: <20221029081522.B6FA23858D20@sourceware.org> Date: Sat, 29 Oct 2022 08:15:10 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D45f8296e6965= ff4e2ca855e995149add6352645d commit 45f8296e6965ff4e2ca855e995149add6352645d Author: Tsukasa OI Date: Mon Sep 26 07:03:00 2022 +0000 sim/m32r: Initialize "list" variable =20 The variable "list" is only initialized when arg1 > 0 and when arg1 =3D= =3D 0, an uninitialized value is passed to translate_endian_h2t function. =20 Although this behavior is harmless, this commit adds initialization to = avoid a GCC warning ("-Wmaybe-uninitialized"). Diff: --- 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 =3D NULL; =20 if (arg1 > 0) list =3D (gid_t *) malloc (arg1 * sizeof(gid_t));