Only the statement "32 bit platform" doesn't mean that int
and long
both have 32 bits, as well as their unsigned
counterparts.
So yes, indeed this can happen if unsingned long
, what %lu
is made for, is longer than unsigned int
.
But even if the lengths are equal, the types are not compatible, so formally it is undefined behaviour.