Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 22:14:05 -0800
From:      Eitan Adler <lists@eitanadler.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Kevin Lo <kevlo@freebsd.org>, FreeBSD Standards <freebsd-standards@freebsd.org>,  FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: Marking select(2) as restrict
Message-ID:  <CAF6rxg=wNVgDUF9o744ngmzPNeHB3hqdrLufy=yS3D4osczxFQ@mail.gmail.com>
In-Reply-To: <CANCZdfo46bhfaRpbqOmJjk4%2B=1R2c5kvmrJPENaxNgK==5M4kg@mail.gmail.com>
References:  <CAF6rxg=h_oMiUu7P=GAOQf_OySQM2w31hg6Kas%2B3jeEM3qq_Cg@mail.gmail.com> <CAF6rxgnt9c0n8i-nHQwoKGbZKF2hM5AZqEJnz0CLo26XOO4_sg@mail.gmail.com> <20180221032247.GA81670@ns.kevlo.org> <CAF6rxg=WwqeBnmJzfOZgtwrYesXPfvJFeaVmQwtTa_89_sxaJg@mail.gmail.com> <CANCZdfo46bhfaRpbqOmJjk4%2B=1R2c5kvmrJPENaxNgK==5M4kg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 February 2018 at 21:19, Warner Losh <imp@bsdimp.com> 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
though:

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF6rxg=wNVgDUF9o744ngmzPNeHB3hqdrLufy=yS3D4osczxFQ>