GCC – printf for size_t

gccprintfsize-tstring-formatting

Is there any way to give printf a size_t without either casting it first or generating a compiler warning? (I always compile with -Wall.)

Best Answer

printf("%zu", sizeof(whatever));