Lev Serebryakov
2017-06-21 20:41:45 UTC
Here are problem, which was discussed in the past, but without this
"all warnings enabled" part.
So, I need to printf() uint64_t in my project, which is built in strict
ISO C11 mode and with all warnings enabled.
If I try to use "%llu" I get warning that "unknown conversion type
character 'l' in format". If I use "%I64u" I get "ISO C does not support
the 'I64' ms_printf length modifier" warning.
PRIu64 doesn't work, of course, because it is "I64u".
How to write portable code without warnings?
And bonus question: how to print size_t, as %zu isn't supported either!
"all warnings enabled" part.
So, I need to printf() uint64_t in my project, which is built in strict
ISO C11 mode and with all warnings enabled.
If I try to use "%llu" I get warning that "unknown conversion type
character 'l' in format". If I use "%I64u" I get "ISO C does not support
the 'I64' ms_printf length modifier" warning.
PRIu64 doesn't work, of course, because it is "I64u".
How to write portable code without warnings?
And bonus question: how to print size_t, as %zu isn't supported either!
--
// Black Lion AKA Lev Serebryakov
// Black Lion AKA Lev Serebryakov