Newlib's strtol() is not standard-compliant
Jeff Johnston
jjohnstn@redhat.com
Wed Sep 16 20:57:00 GMT 2026
Ok. Will make a similar change to each.
-- Jeff J.
On Wed, Sep 16, 2026 at 3:11 PM Howland, Craig D. - US <
craig.howland@caci.com> wrote:
> Jeff:
> strtoll() and other friends are based on the same code as strtol(),
> so multiple other places need the same help. In a quick look, strtoll.c,
> strtoul.c, strtoull.c, strtoimax.c, and strtoumax.c, as well as probably
> the corresponding 6 wcs*.c files need the same edit.
> Craig
>
> ------------------------------
> *From:* Jeff Johnston <jjohnstn@redhat.com>
> *Sent:* Tuesday, September 15, 2026 11:11 AM
> *To:* Lavrentiev, Anton (NIH/NLM/NCBI) [C] <lavr@ncbi.nlm.nih.gov>
> *Cc:* newlib@sourceware.org <newlib@sourceware.org>; cygwin@cygwin.com <
> cygwin@cygwin.com>
> *Subject:* Re: [EXTERNAL] Re: Newlib's strtol() is not standard-compliant
>
>
>
>
> Your tweak makes sense, thanks. Compared against glibc with some extra
> examples with sign and whitespace.
>
> -- Jeff J.
>
> On Mon, Sep 14, 2026 at 10:35 PM Lavrentiev, Anton (NIH/NLM/NCBI) [C] <
> lavr@ncbi.nlm.nih.gov> wrote:
>
> > A fix has been pushed to main.
> >
> > -- Jeff J.
>
> Thanks. I checked the fix but unfortunately it does not seem to be
> complete:
>
> "nptr" is not tracking the leading whitespace and / or a sign
> that might appear prior to "0x". So endptr is not going to
> receive a correct value, in either or both of those cases.
>
> Maybe to assign "nptr" with the value of "s" (before bumping it by 2)
> instead of doing just the ++ increment?
>
> Anton Lavrentiev
> Contractor NIH/NLM/NCBI
>
>
> ------------------------------
>
> This electronic message contains information from CACI International Inc
> or subsidiary companies, which may be company sensitive, proprietary,
> privileged or otherwise protected from disclosure. The information is
> intended to be used solely by the recipient(s) named above. If you are not
> an intended recipient, be aware that any review, disclosure, copying,
> distribution or use of this transmission or its contents is prohibited. If
> you have received this transmission in error, please notify the sender
> immediately.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/newlib/attachments/20260916/c10b709e/attachment-0001.htm>
More information about the Newlib
mailing list