printf int64

What is the correct prefix to use? I’ve tried llx but it does not appear to be work.

typedef unsigned long long int uint64_t

LL (uppercase) :question:

After some testing, it appears that int64 are clearly badly process by xprintf functions, whatever is the used compiler. GCC seems to simply ignore the 32 MSB and considers int64 as int32…
However, tests show that this is a bad xprintf behaviour only (i.e. int64 are correctly supported anywhere else).

We are investigating on the issue, trying to make back sprintf functional on this topic (o r at least provide a workaround).

I’m sure i’ve printed 64-bit (long-long) values from Open-AT before - I’ll have to dig back and check…

Please do so… any clue is welcome…

I am using 64bit integers without any issues in my code. I use lld with *printf.

I am however not using GCC. The ARM ADS compiler, while really old, still works fine.

Edit: For some reason, the forum absolutely refuses to accept my sprintf example.

See: https://forum.sierrawireless.com/t/forum-broken/4278/1
And: Technical Issues After Forum Revamping

Hmmm… it appears that I never actually printed them.

Ho-hum.

Beware that it may appear to work; it’s the parameter after the int64 that doesn’t get printed properly.

I’ve used an (int) typecast for now.

char out[20];
out[0]=0;
long long num=12232354532;
for(;num;)
{
memove(&out[1],out,sizeof(out)-1);
out[0]='0'+(num%10);
num/=10;
}

I hate this forum tbh, can’t post anything longer than 30 chars…

But yea, something like the above should work if converting to string is the idea

See my earlier post - there are currently known bugs in the forum:

See: https://forum.sierrawireless.com/t/forum-broken/4278/1
And: Technical Issues After Forum Revamping

IME, it’s specific characters that the forum dislikes - not a length limit…

workaround seems to be to use https

See: https://forum.sierrawireless.com/t/forum-broken/4278/22

Well, in my code now I have

%.15lld - %.15lld

and both get printed correctly (with ARM ADS compiler).