From: Paul Eggert <eggert@cs.ucla.edu>
To: Alejandro Colomar <alx@kernel.org>, libc-alpha@sourceware.org
Cc: "Arsen Arsenović" <arsen@gentoo.org>,
"Andreas Schwab" <schwab@linux-m68k.org>,
"Xi Ruoyao" <xry111@xry111.site>,
"Russ Allbery" <eagle@eyrie.org>
Subject: Re: [PATCH] Use [[gnu::access(none)]] on free(3)
Date: Fri, 26 Jan 2024 13:23:58 -0800 [thread overview]
Message-ID: <b5ca180a-d0be-406b-8957-5c2c49097351@cs.ucla.edu> (raw)
In-Reply-To: <ZbP82-YXk1fjQ35z@debian>
On 2024-01-26 10:41, Alejandro Colomar wrote:
> Please do not apply. Xi pointed out that GCC uses some magic that would
> break with the attribute.
Plus, I'm not seeing the point of either this patch or the earlier one.
'free' is built into the language, and GCC therefore can deduce anything
about 'free' that an attribute would supply. (If glibc made promises
about 'free' that extend the C standard, that might justify adding an
attribute, but this does not appear to be the case here.)
If there's some problem with GCC not deducing enough about 'free' in the
areas discussed on this thread, that can and should be fixed in GCC.
PS. I didn't see the following mentioned so I'll add it here. Putting
'const void *' into the signature of 'free' would incorrectly reject the
conforming C code like this:
void (*f) (void *) = free;
next prev parent reply other threads:[~2024-01-26 21:24 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 13:21 free(3) const void * Alejandro Colomar
2024-01-26 14:24 ` Arsen Arsenović
2024-01-26 15:35 ` Alejandro Colomar
2024-01-26 17:22 ` Arsen Arsenović
2024-01-26 17:55 ` Xi Ruoyao
2024-01-26 18:11 ` Alejandro Colomar
2024-01-26 20:04 ` Arsen Arsenović
2024-01-26 20:07 ` Arsen Arsenović
2024-01-26 17:40 ` Andreas Schwab
2024-01-26 19:45 ` Florian Weimer
2024-01-26 15:13 ` Andreas Schwab
2024-01-26 15:33 ` Alejandro Colomar
2024-01-26 18:09 ` Russ Allbery
2024-01-26 18:23 ` Alejandro Colomar
2024-01-26 18:36 ` Xi Ruoyao
2024-01-26 18:40 ` Alejandro Colomar
2024-01-26 18:49 ` Xi Ruoyao
2024-01-26 18:57 ` Alejandro Colomar
2024-01-26 18:40 ` Russ Allbery
2024-01-26 18:45 ` Alejandro Colomar
2024-01-26 19:41 ` Florian Weimer
2024-01-26 18:39 ` [PATCH] Use [[gnu::access(none)]] on free(3) Alejandro Colomar
2024-01-26 18:41 ` Alejandro Colomar
2024-01-26 21:23 ` Paul Eggert [this message]
2024-01-26 23:19 ` Alejandro Colomar
2024-01-27 13:21 ` Cristian Rodríguez
2024-02-13 15:19 ` Gabriel Ravier
2024-02-13 15:28 ` Alejandro Colomar
2024-01-26 21:11 ` free(3) const void * DJ Delorie
2024-01-26 21:30 ` Andreas Schwab
2024-01-26 21:47 ` DJ Delorie
2024-01-26 22:07 ` Andreas Schwab
2024-01-26 23:25 ` Alejandro Colomar
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=b5ca180a-d0be-406b-8957-5c2c49097351@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=alx@kernel.org \
--cc=arsen@gentoo.org \
--cc=eagle@eyrie.org \
--cc=libc-alpha@sourceware.org \
--cc=schwab@linux-m68k.org \
--cc=xry111@xry111.site \
/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).