From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3F04B3858C2D; Sun, 24 Dec 2023 09:33:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F04B3858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703410413; bh=ZZZa5gj2/S9lIjkF0asYlpUM3/udw3OKoSx9/Jlj6+U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XjmPWc14u+YDBJ+AFmnXfqHelTSU6mLGETdX3gUo5IojuG9nE1P3CBvGXCbp+m0rv sY7lfaAe5YTwk8SQ2bEMRByI8M9MK57YvIoi8+wkBwUiGivrScjnjwMQxE6eOyQo/P 9vhr5JZn+xUmGGHDC4HGnbBX9kUBklb+wWl0VpOQ= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug build/31150] [gdb/build] m_uiout may be used uninitialized in this function [-Wmaybe-uninitialized] Date: Sun, 24 Dec 2023 09:33:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31150 --- Comment #2 from Tom de Vries --- This seems to fix it: ... diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 07567a1df35..0ff9b761102 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -406,14 +405,15 @@ class ui_out_emit_type ~ui_out_emit_type () { - m_uiout->end (Type); + if (m_uiout !=3D nullptr) + m_uiout->end (Type); } DISABLE_COPY_AND_ASSIGN (ui_out_emit_type); private: - struct ui_out *m_uiout; + struct ui_out *m_uiout =3D nullptr; }; typedef ui_out_emit_type ui_out_emit_tuple; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=