Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2018 12:44:00 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Eitan Adler <lists@eitanadler.com>
Cc:        Warner Losh <imp@bsdimp.com>, 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:  <20180221104400.GU94212@kib.kiev.ua>
In-Reply-To: <CAF6rxg=wNVgDUF9o744ngmzPNeHB3hqdrLufy=yS3D4osczxFQ@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> <CAF6rxg=wNVgDUF9o744ngmzPNeHB3hqdrLufy=yS3D4osczxFQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Feb 20, 2018 at 10:14:05PM -0800, Eitan Adler wrote:
> 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.
You certainly seen very little code, but the question was about the
existed code.

> 
> > 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:
What run-time warnings ?  Point out the code that issues them in the 
case of restrict (or generic aliasing) violation.  In libc ?  In kernel ?

Did you even tried to estimate how many code around still requires disabling
alias analysis to run ?  How does restrict mix with no-aliasing option ?

Above question contains a hint how it is possible to detect existing calls
which violate the restrict specifier for select(2), but this requires
running of all select(2) consumers, on patched kernel or libc/libthr.

> 
> 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.
And, how to do plan to classify the bugs appeared due the change ?
What specific indicators would allow you to find them out in the stream
of the bug reports ?

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

I fail to find an explanation of the supposed benefit of the change
you proposing.  Please point it out.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180221104400.GU94212>