Marking select(2) as restrict

Eitan Adler lists at
Wed Feb 21 06:14:37 UTC 2018

On 20 February 2018 at 21:19, Warner Losh <imp at> wrote:
> Once upon a time, this would break a lot of code. Perhaps times have
> changed.

I've seen very little code that this would break though some of it
certainly exists.

> Does the state of the art give warnings,when restrict is violated?

In the general case it can not since aliasing may occur through
run-time warnings. Modern compilers can warn in specific sub-cases

restrict.c:10:6: warning: passing argument 1 to restrict-qualified
parameter aliases with argument 2 [-Wrestrict]
  meh(&a, &a);

> If not,
> how do you propose the ports broken subtlely be detected?

My plan was to commit to current but not MFC. This would allow users
to detect issues and report them.

Another option is to request that POSIX change the definition of
select to not require restrict though I am doubtful this will happen.

Eitan Adler

More information about the freebsd-standards mailing list