It’s not that easy to get printf (3) format right. Especially with datatypes such as
size_t or other
*_ts – which size depends on the system architecture.
You may need to resort to
#include <inttypes.h> and PRI macros defined there.
#include <inttypes.h> uint32_t val; printf("val is: %"PRIu32", unsigned 32 bit", val)