[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lua_Integer in Lua 5.3
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 6 Dec 2013 09:41:51 -0200
> > (For instance, in my Linux, printf has a modifier for long long
> > [ll], but there is no modifier for int64_t.)
>
> Are you sure that you don't have PRI{d,i,o,u,x,X}64 on your system?
No, I am not. I did not say that there is no trick (using an extra
non-C89 header file and a convoluted syntax) to print an int64_t. I
said that printf has no modifier for int64_t, while it has one for long
long. That is what I mean by "better support" for long long.
See next example:
void foo (void) {
printf("%" PRId32 " %lld", (int64_t)9, (long int)10);
}
temp.c:7: warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long long int’
temp.c:7: warning: format ‘%lld’ expects type ‘long long int’, but argument 3 has type ‘long int’
Why the message is not "format ‘%PRId32’ expects type ‘int32_t’,
but argument 2 has type ‘int64_t’ ?
-- Roberto