public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Lancelot SIX <lancelot.six@amd.com>
Cc: <gdb-patches@sourceware.org>,  <lsix@lancelotsix.com>
Subject: Re: [PATCH] gdb/compile: Use std::filesystem::remove_all in cleanup
Date: Fri, 08 Mar 2024 09:27:14 -0700	[thread overview]
Message-ID: <8734t0sn8d.fsf@tromey.com> (raw)
In-Reply-To: <20240303164756.870514-1-lancelot.six@amd.com> (Lancelot SIX's message of "Sun, 3 Mar 2024 16:47:56 +0000")

>>>>> "Lancelot" == Lancelot SIX <lancelot.six@amd.com> writes:

Lancelot> In a previous review, I noticed that some code in gdb/compile/compile.c
Lancelot> could use c++17's `std::filesystem::remove_all` instead of using some
Lancelot> `system ("rm -rf ...");`.

Lancelot> This patch implements this.

Lancelot> Note that I use the noexcept overload of std::filesystem::remove_all and
Lancelot> explicitly check for an error code.  This means that this code called
Lancelot> during the cleanup procedure cannot throw, and does not risk preventing
Lancelot> other cleanup functions to be called.

Lancelot> Tested on x86_64-linux.

Lancelot> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31420
Lancelot> Change-Id: If5668bf3e15e66c020e5c3b4fa999f861690e4cf

Thank you.  I think this is ok.

There might be some risk that there's a compiler that implements C++17
but not std::filesystem.  If this happens I suppose we can either
consider simply rejecting that compiler, or alternatively, revert this
patch.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

  reply	other threads:[~2024-03-08 16:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03 16:47 Lancelot SIX
2024-03-08 16:27 ` Tom Tromey [this message]
2024-04-03 12:56   ` Lancelot SIX
2024-04-03 14:37   ` Tom de Vries
2024-04-03 14:47     ` Lancelot SIX
2024-04-03 14:51       ` Tom de Vries
2024-04-03 17:08         ` Andrew Pinski
2024-04-04  7:40           ` Lancelot SIX

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=8734t0sn8d.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lancelot.six@amd.com \
    --cc=lsix@lancelotsix.com \
    /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: link
Be 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).