public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>
Subject: Re: [PATCH][_GLIBCXX_INLINE_VERSION] Fix std::random_device definition
Date: Thu, 28 Apr 2022 21:57:40 +0200	[thread overview]
Message-ID: <747b9b36-d4b5-0859-8809-21f3dd8796fb@gmail.com> (raw)
In-Reply-To: <CACb0b4nymxm0obNcJEvmig0pDkhQKOXe-a5-K7GuZuBJcBSn6w@mail.gmail.com>

On 28/04/22 11:35, Jonathan Wakely wrote:
> On Thu, 28 Apr 2022 at 05:56, François Dumont via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
>> Hi
>>
>>       Still time for this fix for gcc 12 ?
> What needs fixing?
>
> std::random_device is already declared in the versioned namespace in
> <bits/random.h>:

Oh, I thought it was necessary because it is what is done in most if not 
all the other sources in src.

I might do a cleanup as part of the patch to adopt the cxx11 abi 
std::string in the _GLIBCXX_INLINE_VERSION mode.


>
> namespace std _GLIBCXX_VISIBILITY(default)
> {
> _GLIBCXX_BEGIN_NAMESPACE_VERSION
> ...
>    /**
>     * A standard interface to a platform-specific non-deterministic
>     * random number generator (if any are available).
>     */
>    class random_device
>    {
>
> So that means the definitions of its member functions will be exported
> as std::__8::random_device::* already, the macros are not needed in
> the src/*/*.cc files.
>
> So it seems to me that the only "problem" is a redundant line in
> config/abi/pre/gnu-versioned-namespace.ver. That line has no effect,
> and can be removed.
>
> I've pushed the attached patch instead.
>
>>       If so I'll make sure to run tests quickly, especially the abi.exp
>> one to confirm that the cleanup in gnu-versioned-namespace.ver do not
>> need to be replaced by the same in __8 namespace.
>>
>> libstdc++: [_GLIBCXX_INLINE_VERSION] Fix std::random_device definition
>>
>> Definition shall be put in _GLIBCXX_BEGIN_VERSION_NAMESPACE/
>> _GLIBCXX_END_VERSION_NAMESPACE like the declaration.
>>
>> libstdc++-v3/ChangeLog
>>
>>       * src/c++11/cow-string-inst.cc: Put random_device member definitions
>>       in versioned namespace.
>>       * src/c++11/random.cc: Likewise.
>>       * config/abi/pre/gnu-versioned-namespace.ver: Remove std::random_device
>>       symbols.
>>
>> François



      reply	other threads:[~2022-04-28 19:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28  4:55 François Dumont
2022-04-28  9:35 ` Jonathan Wakely
2022-04-28 19:57   ` François Dumont [this message]

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=747b9b36-d4b5-0859-8809-21f3dd8796fb@gmail.com \
    --to=frs.dumont@gmail.com \
    --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).