The printf function does not correctly handle long
long input parameters in the MinGW environment
(and possible other environments). The printf
function appears to attempt to handle the long
long input. However, it only pulls off one 32-bit
parameter, and does not process the second 32-bit
parameter for the long long. The next format
descriptor will typically use the upper 32-bits of
the previous long long parameter.
Here is code that could repeat this problem:
long long A = 12345678901234LL, B =
printf("%lld, %lld\n", A, B);
GCC release: gcc (GCC) 3.2 (mingw special
Mingw release: MinGW 2.0.0-3 running under
Log in to post a comment.