From 4536b3bb61fd2fc7b3482cdc8d03a2542cdf5d9e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 7 Apr 2022 10:17:02 -0600 Subject: 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. --- gdb/target/waitstatus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/target') diff --git a/gdb/target/waitstatus.h b/gdb/target/waitstatus.h index 7b5faed8..63bbd73 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 -- cgit v1.1