printf of 64bit value on ARM

Jeff Johnston jjohnstn@redhat.com
Tue Nov 29 14:49:00 GMT 2011


Edo,

Did you make sure to include stdio.h in your test case?  This can cause 
problems with the variable parameter list.  If you have already included 
stdio.h, I would suggest debugging _VFPRINTF_R in vprintf.c and 
verifying the variable list long long parameter is being passed and 
restored correctly on the other end (look at the arg_val union).  From 
debugging, you should also verify that the long long code was enabled 
properly.

-- Jeff J.

On 11/27/2011 05:14 PM, Franzi Edo. wrote:
> Hi,
> I am trying to build a newlib for a Cortex M3 ARM capable to support the printf.
> Everything works fine, but I have a strange behavior with the printf of 64bit values.
>
> If I execute this:
>
> ...
> uint64_t val = 1LL;
>
> printf("value = %llu\n", val);
> ...
>
> I got: value = 4294967296
>
> This sounds like a big-little endian problem. Any idea how to solve this problem?
>
> I uses the newlib 1.19.0 and gcc 4.6.2.
> For the newlib configure I use these switches:
>
> 	--enable-newlib-io-long-long \
> 	--enable-interwork \
> 	--disable-libgloss \
> 	--disable-newlib-supplied-syscalls"
>
> Thank's
>    Edo.
>
>



More information about the Newlib mailing list