This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bug in 64-bit printf on PPC


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]