From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>, 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: Wed, 3 Apr 2024 16:37:03 +0200 [thread overview]
Message-ID: <a06e6483-aa2e-4b8a-854f-e369a1e961ea@suse.de> (raw)
In-Reply-To: <8734t0sn8d.fsf@tromey.com>
On 3/8/24 17:27, Tom Tromey wrote:
>>>>>> "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.
This broke the build for me with gcc 7.5.0, which apparently falls into
the category of "mostly implements C++17 but not std::filesystem".
As we can see here ( https://gcc.gnu.org/gcc-8/changes.html#cxx )
support was added in gcc 8.
Thanks,
- Tom
next prev parent reply other threads:[~2024-04-03 14:37 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
2024-04-03 12:56 ` Lancelot SIX
2024-04-03 14:37 ` Tom de Vries [this message]
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=a06e6483-aa2e-4b8a-854f-e369a1e961ea@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=lancelot.six@amd.com \
--cc=lsix@lancelotsix.com \
--cc=tom@tromey.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).