public inbox for gdb-cvs@sourceware.org help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org> To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Silence -Wmaybe-uninitialized warning from target_waitstatus Date: Thu, 14 Apr 2022 16:19:00 +0000 (GMT) [thread overview] Message-ID: <20220414161900.D389B3857827@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4536b3bb61fd2fc7b3482cdc8d03a2542cdf5d9e commit 4536b3bb61fd2fc7b3482cdc8d03a2542cdf5d9e Author: Tom Tromey <tromey@adacore.com> Date: Thu Apr 7 10:17:02 2022 -0600 Silence -Wmaybe-uninitialized warning from target_waitstatus Currently, one use of target_waitstatus yields a warning: target/waitstatus.h: In function 'void stop_all_threads()': target/waitstatus.h:175:13: warning: 'ws.target_waitstatus::m_value' may be used uninitialized in this function [-Wmaybe-uninitialized] 175 | m_value = other.m_value; | ~~~~~~~~^~~~~~~~~~~~~~~ This patch silences the warning. I tried the "volatile member" approach that was used for gdb::optional, but that didn't work, so this patch simply initializes the member. Diff: --- gdb/target/waitstatus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/target/waitstatus.h b/gdb/target/waitstatus.h index 7b5faed83c7..63bbd737749 100644 --- a/gdb/target/waitstatus.h +++ b/gdb/target/waitstatus.h @@ -418,7 +418,7 @@ private: char *execd_pathname; /* Syscall number */ int syscall_number; - } m_value; + } m_value {}; }; /* Extended reasons that can explain why a target/thread stopped for a
reply other threads:[~2022-04-14 16:19 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=20220414161900.D389B3857827@sourceware.org \ --to=tromey@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).