From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: Importing inttypes methods
Date: Fri, 28 Jul 2017 18:29:00 -0000 [thread overview]
Message-ID: <20170728182942.GE24013@calimero.vinschen.de> (raw)
In-Reply-To: <CAC82fA3JPWWex3rcGcxs6b4KDJohUYiPeQ2-_xW7UPJu41nMfw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1752 bytes --]
On Jul 28 10:28, Gedare Bloom wrote:
> On Fri, Jul 28, 2017 at 9:08 AM, Corinna Vinschen <vinschen@redhat.com> wrote:
> > On Jul 28 07:40, Gedare Bloom wrote:
> >> Corinna, good catch. I mentioned this issue to Joel but it dropped out
> >> the bottom some how. Is it only (for example) the strtoimax_l() that
> >> needs to be guarded, or also the _strtoimax_l? (I suspect only the
> >> strtoimax_l, but want to be clear before the next round of patches
> >> lands here.)
> >
> > The reentrant prototypes use locale_t, so they depend on including
> > xlocale.h, too. It's a bit uncommon but the simplest solution.
> >
> Since the non-reentrant version (e.g., strtoimax) wraps the re-entrant
> one, then there is no support unless locale is available. Would it be
> better to have a non-reentrant, nonolocale implementation in tandem
> with the reentrant one, or do we not worry about it and don't support
> these functions at all unless the POSIX_SOURCE is set properly and
> BSD_VISIBLE?
Good catch on your side, I really had to look it up now. Here's how it
is in the other, similar cases like strtol:
There are actually four functions:
strtol
strtol_l
_strtol_r
_strtol_l
_strtol_l is the internal implementation and *static*. _strtol_r
is the exported reentrant function and consequentially not having
the locale_t parameter.
So, why not just keep it at that for now with strtoimax, etc? It only
requires minimal changes and nobody using the reentrant functions
actually asked for a reentrant function with thread-local locale
parameter yet :}
As a result, the guards for the exported reentrant functions are not
required.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-07-28 18:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-25 19:51 Aditya Upadhyay
2017-07-26 11:08 ` Corinna Vinschen
2017-07-26 12:02 ` Sebastian Huber
2017-07-26 12:02 ` Aditya Upadhyay
2017-07-26 21:24 ` Aditya Upadhyay
2017-07-27 12:32 ` Corinna Vinschen
2017-07-27 14:00 ` Aditya Upadhyay
2017-07-28 10:43 ` Corinna Vinschen
2017-07-28 11:02 ` Aditya Upadhyay
2017-07-28 11:40 ` Gedare Bloom
2017-07-28 13:08 ` Corinna Vinschen
2017-07-28 14:28 ` Gedare Bloom
2017-07-28 18:29 ` Corinna Vinschen [this message]
2017-07-29 12:40 ` Gedare Bloom
2017-07-29 13:57 ` Aditya Upadhyay
2017-07-30 8:46 ` Aditya Upadhyay
2017-07-30 15:41 ` Gedare Bloom
2017-07-31 10:08 ` Corinna Vinschen
2017-08-01 8:31 ` Aditya Upadhyay
2017-08-01 12:10 ` Gedare Bloom
2017-07-28 18:24 ` Joel Sherrill
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=20170728182942.GE24013@calimero.vinschen.de \
--to=vinschen@redhat.com \
--cc=newlib@sourceware.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).