Having only thought about this for a few minutes, I am guessing that
you would need to use the Microsoft-style printf modifier and also use
a GCC pragma to suppress the warning:

https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html

--David

On Tue, Sep 6, 2016 at 9:06 AM, Jeroen Ooms <[email protected]> wrote:
> How to print a 'long long int' so that it compiles
> without  -pedantic warnings? I tried:
>
>   long long int number
>   char i[32];
>   sprintf(i, "%lld", number);
>
> But this gives: warning: unknown conversion type character 'l' in format. I
> also tried:
>
>   sprintf(i, "%I64d", number);
>
> But this gives: warning: ISO C does not support the 'I64' ms_printf length
> modifier.
>
> It's a bit of a silly question but my repository maintainers insist that
> code compiles without any pedantic warnings.
> ------------------------------------------------------------------------------
> _______________________________________________
> Mingw-w64-public mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to