Problem with printf and float

Jeppe Ledet-Pedersen
Tue Oct 26 14:23:00 GMT 2010

Hi Pavel, All,

On 2010-10-26 09:05, Jeppe Ledet-Pedersen wrote:
> Thank you for your reply. I have tried your suggestion and both
> __IEEE_LITTLE_ENDIAN and IEEE_8087 are set correctly in both vfprintf.c
> and dtoa.c.
> __IEEE_BYTES_LITTLE_ENDIAN is not set. I don't see where this define is
> used except for endian.h? It seems to me like the current code yields
> the same setting for VFP and FPA in little endian mode, or am I missing
> something?

I did some further testing. If I compile an ELF toolchain (non-EABI) 
with crosstool-NG, I get correct output regardless of whether I use 
-mfpu=vfp or not (and thus defines __VFP_FP__) when compiling newlib.

This is my test output:

00 00 55 c0 00 00 00 00
a is -84.000000

00 00 00 00 00 00 55 c0
a is -84.000000

As soon as I compile for arm-unknown-eabi instead of arm-unknown-elf, I 
can only print if I convert to FPA format.

I'll continue my search. If you have any input or suggestions where to 
look, I'll be happy to hear from you.

Best regards,

More information about the Newlib mailing list