I have the following
size_t i = 0;
uint32_t k = 0;
printf("i [ %lu ] k [ %u ]\n", i, k);
I get the following warning when compiling:
format ‘%lu’ expects type ‘long unsigned int’, but argument has type ‘uint32_t’
When I ran this using splint I got the following:
Format argument 1 to printf (%u) expects unsigned int gets size_t: k
Many thanks for any advice,
Best Answer
Try
The
z
represents an integer of length same assize_t
, and thePRIu32
macro, defined in the C99 headerinttypes.h
, represents an unsigned 32-bit integer.