#define nmemb 1
#define size 32
...
void *_nptr_ = calloc((nmemb), (size));
LOGL(LDEBUGEX, "CALLOC: %#lX nmemb %ld, size %ld", _nptr_, (nmemb), (size));
The conversion specifiers are wrong all three.
The latter two conversion specifiers cause Valgrind to complain, as the amount of data passed in (int
) does not match what the format expects (long
).
The format shall look like:
..., "%p ... %d ... %d", _nptr_, ...
However a "nicer" approach would be:
#define nmemb ((size_t) 1)
#define size ((size_t) 32)
...
..., "%p ... %zu ... %zu", _nptr_, nmemb, size);