Hello, it is a common, but nevertheless wrong assumption, that %z formatter is compatible for different runtimes. Especially msvcrt is all but C99 compatible. If you have enabled the use our C99 compatible printf/scanf implementation via the __USE_MINGW_ANSI_STDIO macro, then you will see that %z will work. To write portable code you can use the 'PRI/SCN' defines from inttypes.h header.
Kai 2018-01-25 16:27 GMT+01:00 lemonsqueeze <[email protected]>: > Hi, > > I'm looking for a portable way to print a size_t. > I thought "%zu" was the recommended way to do it, but I'm getting unknown > format warnings when printf() is called with "%zu". > > I guess i can use something like %llu instead but shouldn't this work in C99 > mode really ? (must be missing something here...) > > Cheers > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Mingw-w64-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
