[Issue] Using printf with int64_t types.
Posted: Thu Oct 13, 2016 4:00 am
I am working with 3rd party code that has logic similar to the following:
The result should have been:
however what is produced is
Through expansion, the core statement is equivalent to:
I'll be the first to say that the source looks "odd" to me ... however googling around, it is apparently quite legitimate. I'm still searching for a workaround or fix. I don't have the opportunity to easily make a permanent change to the source code so the sample above is what I would like to get working.
Code: Select all
#include <inttypes.h>
int 64_t bigi = 1234;
printf("Here is a big int %" PRId64 "\n", bigi);
Code: Select all
Here is a big int 1234
Code: Select all
Here is a big int ld
Code: Select all
printf("Here is a big int %lld\n", bigi);