snprintf warning about long long

Michael Cronenworth mike at cchtml.com
Thu Sep 8 13:56:20 UTC 2011


On 09/08/2011 02:26 AM, Kai Tietz wrote:
> the width specifier "ll" isn't supported by all msvcrt runtime DLLs.
> As gcc needs to be compatible to older versions here, we are warning
> about this.  I would recomment that you are using instead of "ll" then
> constants defined from header<inttypes.h>.  In your case PRIi64 would
> be the correct define.

Thanks.

It looks like -pedantic causes gcc to still complain when I use PRIi64.

warning: ISO C does not support the 'I64' ms_printf length modifier

On a side note, if I compile for a Linux target on a 64-bit host the 
PRIi64 macro results in '%li' instead of '%lli'. I also needed to add a 
( int64_t ) cast to the passed in format variable.


More information about the mingw mailing list