avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Problem with unsigned long long printf()


From: Bernhard Walle
Subject: [avr-libc-dev] Problem with unsigned long long printf()
Date: Tue, 24 Aug 2004 17:16:10 +0200
User-agent: Mutt/1.5.6i

Hello,

following code:

    unsigned long long x = 0x1;
    printf("%x|%x|%x|%x\n", 
                *((unsigned int*)(&x) + 0),
                *((unsigned int*)(&x) + 1),
                *((unsigned int*)(&x) + 2),
                *((unsigned int*)(&x) + 3)
    );
    printf("X = %llu \n", x);

The output is:

    1|0|0|0
    X = 1543650816

While the first proves that the assignment is correct, the second
output is wrong. Does anybody know the reason? Bug?

I'm using avr-libc 1.0.4.


Regards,
Bernhard

-- 
"Only two things are infinite, the universe and human stupidity, 
and I'm not sure about the former."
        -- Albert Einstein

Attachment: pgpmm78X3pHlI.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]