From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH] malloc_stats(): Fix `unsigned int` overflow
Date: Mon, 1 Nov 2021 09:34:04 -0300 [thread overview]
Message-ID: <050a513c-03ce-9bab-126b-1855c2930fad@linaro.org> (raw)
In-Reply-To: <a646adce-08a5-6574-457a-a8f860b9d808@nh2.me>
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.
prev parent reply other threads:[~2021-11-01 12:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 17:11 Niklas Hambüchen
2021-10-29 19:50 ` DJ Delorie
2021-10-30 0:36 ` Niklas Hambüchen
2021-10-30 1:39 ` Siddhesh Poyarekar
2021-10-30 6:55 ` Andreas Schwab
2023-11-13 18:27 ` [PATCH v2] " Niklas Hambüchen
2023-11-13 20:25 ` DJ Delorie
2023-11-13 23:10 ` Niklas Hambüchen
2023-11-13 23:23 ` DJ Delorie
2021-11-01 12:34 ` Adhemerval Zanella [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=050a513c-03ce-9bab-126b-1855c2930fad@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).