From: Alexandre Oliva <oliva@adacore.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
gcc Patches <gcc-patches@gcc.gnu.org>,
Joel Brobecker <brobecker@adacore.com>
Subject: Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp
Date: Tue, 05 Jul 2022 14:45:57 -0300 [thread overview]
Message-ID: <or4jzvpi5m.fsf@lxoliva.fsfla.org> (raw)
In-Reply-To: <CACb0b4n6n_aj_0_YUrZH51+6qFbVDesC_tGEVps9QYsmCOcyUQ@mail.gmail.com> (Jonathan Wakely's message of "Tue, 5 Jul 2022 10:16:16 +0100")
On Jul 5, 2022, Jonathan Wakely <jwakely@redhat.com> wrote:
> The cast itself is fine, but I'd like a comment like "N.B. pid_t is a
> pointer on vxworks" so I don't "simplify" it again.
libstdc++: testsuite: why cast getpid result
Add a comment next to the getpid call to explain why the typecast is
needed.
Regstrapped on x86_64-linux-gnu, will install later today if there's no
objection.
for libstdc++-v3/ChangeLog
* testsuite/util/testsuite_fs (nonexistent_path): Explain why
we need the typecast.
---
libstdc++-v3/testsuite/util/testsuite_fs.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libstdc++-v3/testsuite/util/testsuite_fs.h b/libstdc++-v3/testsuite/util/testsuite_fs.h
index 25f8f734dc792..0e28385e99aca 100644
--- a/libstdc++-v3/testsuite/util/testsuite_fs.h
+++ b/libstdc++-v3/testsuite/util/testsuite_fs.h
@@ -162,7 +162,8 @@ namespace __gnu_test
if (file.length() > 64)
file.resize(64);
// The combination of random counter and PID should be unique for a given
- // run of the testsuite.
+ // run of the testsuite. N.B. getpid() returns a pointer type on vxworks
+ // in kernel mode.
file += std::to_string((unsigned long) ::getpid());
p = std::move(file);
if (test_fs::exists(p))
--
Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/
Free Software Activist GNU Toolchain Engineer
Disinformation flourishes because many people care deeply about injustice
but very few check the facts. Ask me about <https://stallmansupport.org>
next prev parent reply other threads:[~2022-07-05 17:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-22 6:04 Alexandre Oliva
2022-06-22 9:16 ` Jonathan Wakely
2022-06-23 11:39 ` Alexandre Oliva
2022-06-23 16:36 ` Jonathan Wakely
2022-06-27 9:31 ` Alexandre Oliva
2022-06-27 10:18 ` Jonathan Wakely
2022-07-05 9:10 ` Alexandre Oliva
2022-07-05 9:16 ` Jonathan Wakely
2022-07-05 17:45 ` Alexandre Oliva [this message]
2022-07-05 18:02 ` Jonathan Wakely
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=or4jzvpi5m.fsf@lxoliva.fsfla.org \
--to=oliva@adacore.com \
--cc=brobecker@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jwakely@redhat.com \
--cc=libstdc++@gcc.gnu.org \
/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).