public inbox for
 help / color / mirror / Atom feed
From: Jonathan Wakely <>
To: Alexandre Oliva <>
Cc: "libstdc++" <>,
	gcc Patches <>,
	Joel Brobecker <>
Subject: Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp
Date: Tue, 5 Jul 2022 10:16:16 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, 5 Jul 2022 at 10:10, Alexandre Oliva via Libstdc++
<> wrote:
> On Jun 27, 2022, Alexandre Oliva <> wrote:
> > On Jun 23, 2022, Jonathan Wakely <> wrote:
> >> The attached makes this a bit more efficient, and makes more of the
> >> code common to the mkstemp and non-mkstmp branches. I'll wait to hear
> >> back from you before pushing it (since it has Joel's name on the
> >> patch).
> > Thanks, I've given it a spin, both trunk and gcc-11, and I confirm it
> > works for us.
> The bad news is that it broke on some other systems I didn't test back
> then.  It turns out the type cast for the ::getpid result was not just
> because it was passed to printf before :-/

Ah, whoops.

I did check that POSIX requires pid_t to be a signed integer type, but
that doesn't mean it's always true for all GCC targets.

> libstdc++: testsuite: cast getpid result
> On vxworks, in kernel mode, getpid's return type is a pointer type, so
> std::to_string on it fails overload resolution.  Restore the type cast
> from the original patch that suggested adding the pid.
> Regstrapped on x86_64-linux-gnu, also tested on aarch64-rtems6.0 and
> ppc64-vx7r2.  I'm going ahead and checking this in as obvious.  Please
> let me know if you'd prefer this to be fixed in a different way.

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.


  reply	other threads:[~2022-07-05  9:16 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 [this message]
2022-07-05 17:45             ` Alexandre Oliva
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* 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).