From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [209.51.188.92]) by sourceware.org (Postfix) with ESMTPS id CD30D3858C83 for ; Sun, 27 Mar 2022 05:20:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CD30D3858C83 Received: from [2001:470:142:3::e] (port=38010 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYLK2-0001hK-RT; Sun, 27 Mar 2022 01:20:14 -0400 Received: from [87.69.77.57] (port=4488 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYLK2-00077i-B3; Sun, 27 Mar 2022 01:20:14 -0400 Date: Sun, 27 Mar 2022 08:20:13 +0300 Message-Id: <83k0cg9dki.fsf@gnu.org> From: Eli Zaretskii To: Simon Marchi Cc: brobecker@adacore.com, gdb-patches@sourceware.org In-Reply-To: (message from Simon Marchi on Sat, 26 Mar 2022 21:55:38 -0400) Subject: Re: GDB 12.0.90 available for testing References: <20220320055815.2A90FA4D6C@takamaka.home> <83sfr4a93r.fsf@gnu.org> X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2022 05:20:17 -0000 > Date: Sat, 26 Mar 2022 21:55:38 -0400 > Cc: gdb-patches@sourceware.org > From: Simon Marchi > > > CXX infrun.o > > In file included from btrace.h:30, > > from gdbthread.h:29, > > from infrun.h:21, > > from infrun.c:23: > > 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; > > | ~~~~~~~~^~~~~~~~~~~~~~~ > > > > Is this a real problem? > > I think this one is not really a problem. It complains about this code: > > target_waitstatus ws; > ws.set_no_resumed (); > return {NULL, minus_one_ptid, std::move (ws)}; > > When settnig `ws` using `set_no_resumed`, the union field ws::m_value is > left untouched, meaning it contains random bytes. When we move `ws`, we > copy random bytes. But that doesn't matter, because the destination > target_waitstatus is of kind TARGET_WAITKIND_NO_RESUMED, so doesn't care > about m_value. Maybe we should initialize ws::m_value, just to shut up the compiler? Because GDB 12 compiles cleanly other than this warning.