I can't count the number of times I've corrected printf format specifiers to match their argument. Any mismatch is undefined behavior.
- No, you must not pass an
int (or long) to %x - an unsigned int is required
- No, you must not pass an
unsigned int to %d - an int is required
- No, you must not pass a
size_t to %u or %d - use %zu
- No, you must not print a pointer with
%d or %x - use %p and cast to a void *