printf issue

Ian Lance Taylor iant@google.com
Wed May 4 14:46:00 GMT 2011


Fan Chongbin-B32609 <B32609@freescale.com> writes:

> My image was built with arm-none-eabi-xxx tool chain(2008-q3). And the compile options as follow.
> FCFLAG = -msoft-float -mfloat-abi=soft -mno-apcs-float
> FAFLAG = -msoft-float -mfloat-abi=soft
> CFLAG = -mcpu=cortex-a8 $(FCFLAG) -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -mapcs -g -O0 -ffunction-sections -fdata-sections -fno-exceptions -I.
> AFLAG = -mcpu=cortex-a8 $(FAFLAG) -Wall -Wundef -mapcs -g -O0 -I. -lc  -nostartfiles -T src/mx53_iram.ld
>
> In the main.c file , I used printf("%f",1.0f); to print a float number but the output is 0.0000.
> Can anybody help me to figure that out, pls?

You mention 2008-q3 which makes me think that you have a full toolchain
from some provider; your first step should be to ask them for help.  You
didn't mention which C library you are using; gcc is only a compiler and
does not provide a library.  Does it work if you pass a double rather
than a float?  Does it work if you use %d and pass an integer?

Ian



More information about the Gcc-help mailing list