From 45f8296e6965ff4e2ca855e995149add6352645d Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Mon, 26 Sep 2022 07:03:00 +0000 Subject: [PATCH] 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"). --- 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.30.2