This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
Bug in 64-bit printf on PPC
- To: libc-alpha@cygnus.com
- Subject: Bug in 64-bit printf on PPC
- From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
- Date: Sun, 14 Feb 1999 19:17:55 +0100
- Cc: geoffk@ozemail.com.au
Hi,
this little program:
#include <stdio.h>
int main()
{
printf("%llx\n",0xffff00000000208bULL);
printf("%llu\n",0xffff00000000208bULL);
printf("%llx\n",18446462598732849291ULL);
printf("%llu\n",18446462598732849291ULL);
printf("%llx\n",18359476226655002763ULL);
printf("%llu\n",18359476226655002763ULL);
return 0;
}
results on PPC in:
ffff00000000208b
18359476226655002763
ffff00000000208b
18359476226655002763
fec9f65b0000208b
18278463854511923339
which is wrong for the %llu cases. On x86 this program outputs:
ffff00000000208b
18446462598732849291
ffff00000000208b
18446462598732849291
fec9f65b0000208b
18359476226655002763
which is correct.
This should probably be added to the testsuite.
Franz.