Page 1 of 1

chprintf - %ld

Posted: Wed Oct 02, 2013 12:25 am
by pito
I cannot get chprintf print a %ld (or %LD), I am getting an int. Any hint how to print an int64_t?

Code: Select all

    uxtms = 999888777666L;
    chprintf(chp, "%d   %ld\r\n", uxt, uxtms);
..
1380670167   433985367

Interestingly, when the uxt (int32_t) increments, the uxtms (int64_t) increments as well..

Code: Select all

1380670542   433985742
1380670559   433985759

Re: chprintf - %ld

Posted: Wed Oct 02, 2013 7:54 am
by Giovanni
Hi,

64 bits are not supported currently, %ld refers to a 32 bits word. It is printing the lower half, this explains that increment too.

Giovanni

Re: chprintf - %ld

Posted: Wed Oct 02, 2013 2:10 pm
by pito
The uxtms gets a constant number, why it increments then? :)

Re: chprintf - %ld

Posted: Wed Oct 02, 2013 2:50 pm
by Giovanni
Probably it is matter of parameters passing in registers.

Giovanni