CYGWIN 2.3.0 [32/64]: strtold() seems to be broken
Tino Lange
tino.lange@web.de
Fri Nov 13 11:58:00 GMT 2015
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).
Please let me know if you need more information.
Thanks and best regards,
Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 117322 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20151113/10d98358/attachment.obj>
-------------- next part --------------
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
More information about the Cygwin
mailing list