From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B06D384640D; Wed, 3 Apr 2024 12:54:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B06D384640D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712148843; bh=YkoO8gaNPwmCPHCJAR5m8vgnqX5g9LZbY31+I6vEHwA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dqH4UQkIidNnmGtp6q3809LFLlOOgNhaeim+cB5mQC2tpPsMWwNfjfsFzGRhf3Fuk 6DuAeUdZH1Nog4YXdq9qUlhw6Ik3JEB/qBf6UbXe9QaFxhkURz4tY9IS9+Tt5ExMO7 837/zj/XKGCRDjwK3NDg5UVwie9upnJuMgi+00bE= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31420] Use std::filesystem::remove_all in compile.c Date: Wed, 03 Apr 2024 12:54:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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=3D31420 --- Comment #2 from Sourceware Commits --- The master branch has been updated by Lancelot SIX : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7bba0ad08576= 309763e3f41193eaa93025e10b8b commit 7bba0ad08576309763e3f41193eaa93025e10b8b Author: Lancelot SIX Date: Sun Mar 3 16:47:56 2024 +0000 gdb/compile: Use std::filesystem::remove_all in cleanup In a previous review, I noticed that some code in gdb/compile/compile.c could use c++17's `std::filesystem::remove_all` instead of using some `system ("rm -rf ...");`. This patch implements this. Note that I use the noexcept overload of std::filesystem::remove_all and explicitly check for an error code. This means that this code called during the cleanup procedure cannot throw, and does not risk preventing other cleanup functions to be called. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31420 Change-Id: If5668bf3e15e66c020e5c3b4fa999f861690e4cf Approved-By: Tom Tromey --=20 You are receiving this mail because: You are on the CC list for the bug.=