From: Tsukasa OI Date: Mon, 26 Sep 2022 07:03:00 +0000 (+0000) Subject: sim/m32r: Initialize "list" variable X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=45f8296e6965ff4e2ca855e995149add6352645d;p=binutils-gdb.git sim/m32r: Initialize "list" variable 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"). --- 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));