Some background: If I wanted to use for, for instance, scanf() to convert a string into a standard integer type, like uint16_t, I’d use SCNu1
scanf()
uint16_t
SCNu1
If you are really concerned you can _assert(sizeof(pid_t) <= long) or whatever type you choose for your '%' stuff.
_assert(sizeof(pid_t) <= long)
As explained in this answer, the spec says signed int. If 'int' changes, your '%u' by definition changes with it.
signed int