[PATCH] Fix strtod for small DBL_DIG

Peter Rosin peda@lysator.liu.se
Mon May 16 13:45:00 GMT 2011


Den 2011-05-16 14:33 skrev Corinna Vinschen:
> Thanks for the testcase.  However, I can still not reproduce the
> problem.  I tried again with float and strtof on Cygwin, but
> regardless of running it with or without your patch, it results
> in printing
> 
>   12.3456789 12.3456789
> 
> The strtod_r code is plain C so I'd expect that the conversion
> is target independent.  So why would it fail for arm but not for
> i386?

Perhaps the reason for that is that in the arm case the double inside
strtod_r is only 32 bits? Try replacing the local doubles with floats?

There's also a whole bunch of code conditional on _DOUBLE_IS_32BITS
to consider.

Cheers,
Peter



More information about the Newlib mailing list