[PATCH] Use [[gnu::access(none)]] on free(3)
Paul Eggert
eggert@cs.ucla.edu
Fri Jan 26 21:23:58 GMT 2024
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;
More information about the Libc-alpha
mailing list