snprintf warning about long long

Michael Cronenworth mike at cchtml.com
Wed Sep 7 18:08:29 UTC 2011


Hi all,

I am getting a warning out of gcc that it doesn't know about %lli in 
snprintf(). If I use sprintf() I don't see a warning. If I use 
snprintf() and ignore the warning the resulting binary seems to work 
just fine.

Known bug or am I doing something wrong?

Example code:
snprintf( sixtyFourByteStr, 63, "%lli", sixtyFourBitInt );

Gcc output:
CFLAGS = -mms-bitfields -g -Wall -pedantic -std=c99 -D _WIN32_WINNT=0x0501
foo.c:1:35: warning: unknown conversion type character 'l' in format
foo.c:1:35: warning: too many arguments for format


More information about the mingw mailing list