[PATCH] malloc_stats(): Fix `unsigned int` overflow

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Nov 1 12:34:04 GMT 2021



On 29/10/2021 21:36, Niklas Hambüchen via Libc-alpha wrote:
> The error:
> 
>> malloc.c:5169:48: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
> 
> glibc doesn't require C99, so I guess "%zu" is not an option, right?

We build glibc with -std=gnu11, so we do require a compile that at least support
C11.

> 
> Since this is just in an `fprintf`, would casting to `(unsigned long long)` and using "%llu" be considered acceptable?

Either way would be fine.



More information about the Libc-alpha mailing list