From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Siddhesh Poyarekar <siddhesh@sourceware.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH v2] xmalloc: Fix warnings with gcc analyzer
Date: Wed, 28 Jul 2021 13:25:16 +0200 [thread overview]
Message-ID: <87o8am8yub.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <6285ea15-68a1-38a0-712c-f47188275951@sourceware.org> (Siddhesh Poyarekar's message of "Wed, 28 Jul 2021 16:53:34 +0530")
* Siddhesh Poyarekar:
> On 7/28/21 4:44 PM, Florian Weimer via Libc-alpha wrote:
>> * Siddhesh Poyarekar:
>>
>>> extern void *xrealloc (void *o, size_t n)
>>> + __attribute_malloc__ __attribute_alloc_size__ ((2)) __attr_dealloc_free
>>> + __returns_nonnull;
>> Sorry, this one has again __returns_nonnull for xrealloc.
>
> The xrealloc in programs does a malloc(1) if the size requested is 0,
> so it never really returns a NULL.
So it does not free anything ever?
We should not have two different attributes for xrealloc. I suggest to
drop the attribute from the include/* version for now, until we can
clean this up.
Thanks,
Florian
next prev parent reply other threads:[~2021-07-28 11:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-28 10:33 [PATCH v2] xmalloc: Fix warnings with gcc analyzer Siddhesh Poyarekar via Libc-alpha
2021-07-28 11:14 ` Florian Weimer via Libc-alpha
2021-07-28 11:23 ` Siddhesh Poyarekar via Libc-alpha
2021-07-28 11:25 ` Florian Weimer via Libc-alpha [this message]
2021-07-28 11:27 ` Siddhesh Poyarekar via Libc-alpha
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o8am8yub.fsf@oldenburg.str.redhat.com \
--to=libc-alpha@sourceware.org \
--cc=fweimer@redhat.com \
--cc=siddhesh@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).