public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim/m32r: Initialize "list" variable
@ 2022-10-29 8:15 Tsukasa OI
0 siblings, 0 replies; only message in thread
From: Tsukasa OI @ 2022-10-29 8:15 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=45f8296e6965ff4e2ca855e995149add6352645d
commit 45f8296e6965ff4e2ca855e995149add6352645d
Author: Tsukasa OI <research_trasio@irq.a4lg.com>
Date: Mon Sep 26 07:03:00 2022 +0000
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:
---
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));
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-29 8:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 8:15 [binutils-gdb] sim/m32r: Initialize "list" variable Tsukasa OI
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).