public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: CYGWIN 2.3.0 [32/64]: strtold() seems to be broken
Date: Mon, 16 Nov 2015 13:05:00 -0000	[thread overview]
Message-ID: <20151116130520.GD6402@calimero.vinschen.de> (raw)
In-Reply-To: <20151113125805.11bc0862@bartinux>

[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]

Hi Tino,

On Nov 13 12:58, Tino Lange wrote:
> Hi Cygwin Developers,
> 
> strtold() seems to be broken, at least when there is additional
> non-numeric data after the initial numeric part.
> 
> Code:
> 
> > #include <iostream>
> > #include <stdlib.h>
> > 
> > int main()
> > {
> >   char* endptr;
> >   const char * v = "1234abc";
> >   const long double value = strtold(v, &endptr);
> >   std::cout << v << " -> " << value << "\n";
> > }
> 
> Linux (expected result):
> > 1234abc -> 1234
> 
> CYGWIN (unexpected/wrong result):
> > 1234abc -> -e+999
> 
> Note that using strtod() instead of strtold() on CYGWIN gives the
> expected result. strtod() and strtold() implementations seem to differ
> here.
> 
> BTW: There seem to be more strange things going on with strtold() on
> CYGWIN32/64, see also:
> https://stackoverflow.com/questions/29040427/unexpected-endptr-with-strtod-strtold
> (tested today with recent CYGWIN, the reported inconsistency can still
> be reproduced).
> 
> "cygcheck.out" attached (from a CYGWIN64 box, but this can also be
> reproduced on a CYGWIN32 box).

Strtold is implemented in newlib, our underlying libc, so this doesn't
only affect Cygwin but all newlib targets.  Would you mind to report
this to the newlib AT sourceware DOT org mailing list so we can discuss
this there?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-11-16 13:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 11:58 Tino Lange
2015-11-16 13:05 ` Corinna Vinschen [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=20151116130520.GD6402@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin@cygwin.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).