Long long printing problems with newlib 1.16.0?

Franzi Edo. edo.franzi@ukos.ch
Thu Jan 3 17:21:00 GMT 2008


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? Whit the previous version of the newlib 1.15.0,  
the flag "--enable-newlib-io-long-long" was enough.

Any advises?

My configuration:

TARGET=m68k-elf
BINUTILS_VER=2.18.50
GCC_VER=4.2.8
NEWLIB_VER=1.16.0
...
cd $TARGET_DIR/builds/$TARGET
mkdir gcc-$GCC_VER
cd gcc-$GCC_VER
../../../GCC/gcc-$GCC_VER/configure --target=$target --prefix=$prefix  
--enable-languages=c --with-newlib --enable-newlib-io-long-long --with- 
gnu-as --with-gnu-ld
make "CFLAGS = -DREENTRANT_SYSCALLS_PROVIDED"
make install

Regards
   Edo.



More information about the Newlib mailing list