This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
printf of unsigned long long in ARM processors
- From: Andrés Moré <more dot andres at gmail dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 20 Sep 2005 12:33:14 -0300
- Subject: printf of unsigned long long in ARM processors
- Reply-to: Andrés Moré <more dot andres at gmail dot com>
Hi All,
I'm trying to cross compile some tools to an ARM Xscale processor.
I have a problem regarding the output of printf when passing some
unsigned long long values. I had tested in i386 and ppc32 successfully
but I can't understand this type of behavior in the ARM processor.
Using printk's from linux kernel in kernel-space modules I see the
correct output.
That why I'm writing to this list.
{
unsigned long long value = 0x1234;
if (value == (unsigned long long) 0x1234)
{
printf("Equal\n");
}
printf("%llx\n",value);
printf("%Lx\n", value);
}
Equal
123400000000
123400000001
I'm compiling with this CFLAGS: "-txscale -mbig-endian" using "-W and
-Wall" with
Please note that the ARM processor is big endian.
I have the following version of gcc and ld.
arm-linux-gnueabi-gcc -v
Reading specs from
/toolchain/xscale_be/bin/../lib/gcc/arm-wrs-linux-gnueabi/3.4.4/specs
Configured with: /src/linux/src/gcc-3.4.4/configure --disable-nls
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu
--target=arm-linux-gnueabi --enable-languages=c,c++ --disable-checking
--enable-shared --enable-threads --disable-libmudflap --disable-libssp
--with-gnu-as --with-gnu-ld --prefix=/opt/arm --enable-symvers=gnu
--enable-__cxa_atexit
--with-build-sysroot=/install/arm-linux-gnueabi/libc
--with-sysroot=/opt/arm/arm-linux-gnueabi/libc --enable-threads
--enable-shared
Thread model: posix
gcc version 3.4.4
GNU ld version 2.15.96 20050323
Supported emulations:
armelf_linux_eabi
armelfb_linux_eabi
Thanks in advance & best regards.
Andrés Moré
Computer Science Student