WG14 paper for removing restrict from nptr in strtol(3)
Alejandro Colomar
alx@kernel.org
Tue Jul 9 09:07:59 GMT 2024
Hi Dave,
On Mon, Jul 08, 2024 at 06:48:51PM GMT, David Malcolm wrote:
> > restrict, as of the formal definition of ISO C is useless crap. The
> > more I read it, the more I agree.
>
> Please note that "useless crap" was your wording, not mine.
Yup. :)
>
> >
> > restrict, as of what -Wrestrict warns about, seems a reasonable
> > thing.
> >
> > How about a [[gnu::restrict()]] attribute, similar to
> > [[gnu::access()]],
> > which is simpler than the qualifier? Since restrict is only
> > meaningful
> > in function boundaries, it would make sense to have a function
> > attribute. We don't want a qualifier that must follow discarding
> > rules.
>
> If it doesn't have the same meaning as "restrict" then perhaps call the
> proposed attribute something other than "restrict"?
Yup, I was thinking that maybe noalias is a better name.
>
> That said, I don't have strong opinions on any of this, except to note
> that I have more than enough *other* work on improvements to GCC's
> static analyzer and usability to keep me busy, so getting sucked into
> discussion/implementation on 'restrict' is something I want to avoid,
> and -Wanalyzer-overlapping-buffers is getting the job done for me at
> the moment.
>
> [...snip...]
>
> Hope this is constructive; sorry again if I missed anything due to only
> skimming the thread
It is. I don't want you to work on this if you don't have time or
interest. Just having the idea floating aroud, and if somebody finds
time to have a look at it in the next decade, maybe try it. :-)
Does that make sense?
Cheers,
Alex
>
> Dave
>
>
--
<https://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20240709/45bde02c/attachment-0001.sig>
More information about the Gcc
mailing list