It goes the other way too. One of my worst memories from Java was when OpenJDK authors decided that they want the maximum array size to be the same (signed int32 range) on different CPU architectures and heap sizes without testing it or anything. It turned out that with enough small objects, that counter overflows. Of course having 2^29 tiny objects around was huge overhead to begin with so I understand why it hadn't been tested and why it doesn't usually happen in real life, but it would have been pretty easy avoid with simple "if it's a size, use size_t" heuristic.
After you accept that size_t can be platform specific and there's nothing scary about it, the format string issue is solved with something like "%z".
After you accept that size_t can be platform specific and there's nothing scary about it, the format string issue is solved with something like "%z".