On 09/11/2014 07:20 PM, Assaf Gordon wrote: > > On 09/11/2014 11:48 AM, Pádraig Brady wrote: >>> >>> I wonder if there's a definition in "inttypes.h" or similar that would be a >>> correct one to use, >>> or if there's another portable way to compile it. >> >> I've some notes on printing int values at: >> http://www.pixelbeat.org/programming/gcc/int_types/ > > That's a very informative example, thanks! > For reference, below are the warnings that this example program gives with > mingw. >
> ## 64bit mingw with special CFLAG, no warnings: > $ x86_64-w64-mingw32-gcc -Wall -Wextra -D__USE_MINGW_ANSI_STDIO=1 int_types.c > > ## 64bit mingw > $ x86_64-w64-mingw32-gcc -Wall -Wextra int_types.c > int_types.c: In function 'main': > int_types.c:38:12: warning: unknown conversion type character 'z' in format > [-Wformat] Ah right. One needs _POSIX defined, not _ISOC99_SOURCE. I've adjusted my example to explicitly define __USE_MINGW_ANSI_STDIO instead. thanks, Pádraig.