[PATCH] Fix strtod for small DBL_DIG

Christian Bruel christian.bruel@st.com
Wed May 18 07:16:00 GMT 2011



On 05/16/2011 03:35 PM, Corinna Vinschen wrote:
> On May 16 15:27, Peter Rosin wrote:
>> 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.
>
> You have a point there.  Ok, I can't test that easily and since it
> works fine for sizeof(double)==8 systems, and since Christian has
> apparently tested his patch, I checked it in.
>

Many thanks,

Just note for the record that the original report was for SH4, not ARM. 
(although I did test on ARM as well).

Best Regards

Christian

>
> Thanks,
> Corinna
>



More information about the Newlib mailing list