printf and "unsigned long long" numbers

Jeff Johnston jjohnstn@redhat.com
Mon May 21 07:41:00 GMT 2007


Franzi Edo. wrote:
> Hi,
> I tried to use printf in a cross 68k machine. The print "unsigned long 
> long" seems not to work.
> 
> unsigned long long a = 9888994872930475ull;
> 
> printf("%llu", a)
> -> gives as a result 2302461                       on my cross target 68k
> -> gives as a result 9888994872930475  on my host machine OSX
> 
> How do I have to configure newlib to correctly support long long int on 
> embedded targets?
> 

Specify --enable-newlib-io-long-long when you configure newlib prior to 
building it.

-- Jeff J.



More information about the Newlib mailing list