public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tsukasa OI <a4lg@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/m32r: Initialize "list" variable Date: Sat, 29 Oct 2022 08:15:10 +0000 (GMT) [thread overview] Message-ID: <20221029081522.B6FA23858D20@sourceware.org> (raw) 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));
reply other threads:[~2022-10-29 8:15 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20221029081522.B6FA23858D20@sourceware.org \ --to=a4lg@sourceware.org \ --cc=gdb-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).