sprintf bugs with floating point and field specifiers?

Dave Korn dave.korn@artimi.com
Wed Sep 6 20:04:00 GMT 2006


On 06 September 2006 00:10, Matt Lee wrote:

> I am seeing some bugs with Newlib sprintf and floating point format
> specifiers. Specifically, the following bits of code work incorrectly,

> Output On Xilinx PowerPC 405 platform,
> 
> +00
> 0000
> +000
> 
> while on desktop Linux I get,
> 
> +00.0
> 00000
> +0000

  On current cygwin, I get

dk@rainbow /artimi/software> ./foo.exe
+00.0
00000
+0000
dk@rainbow /artimi/software>

> I have tried both Newlib 1.9.0 and 1.14.0 and see the same behavior. I
> am running a powerpc-eabi toolchain with Newlib configured for
> floating point support.
> 
> I found a few email trails, that seem to discuss related issues but
> were not really the same things? I will try to debug _dtoa_r() and
> cvt(), but wanted to know if this is known behavior.

  Well, we do know that bugs crop up in the dtoa stuff every now and again on
odd corner cases.  Can you reproduce this if you build newlib from the current
CVS HEAD?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....



More information about the Newlib mailing list