public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Alexandre Oliva <oliva@adacore.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, 5 Jul 2022 10:16:16 +0100	[thread overview]
Message-ID: <CACb0b4n6n_aj_0_YUrZH51+6qFbVDesC_tGEVps9QYsmCOcyUQ@mail.gmail.com> (raw)
In-Reply-To: <ory1x8orgh.fsf@lxoliva.fsfla.org>

On Tue, 5 Jul 2022 at 10:10, Alexandre Oliva via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> On Jun 27, 2022, Alexandre Oliva <oliva@adacore.com> wrote:
>
> > On Jun 23, 2022, Jonathan Wakely <jwakely@redhat.com> 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.

Thanks.


  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:
  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=CACb0b4n6n_aj_0_YUrZH51+6qFbVDesC_tGEVps9QYsmCOcyUQ@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=oliva@adacore.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).