Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Feb 2018 02:55:29 -0800
From:      Eitan Adler <lists@eitanadler.com>
To:        Garrett Wollman <wollman@csail.mit.edu>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, FreeBSD Standards <freebsd-standards@freebsd.org>
Subject:   Re: Marking select(2) as restrict
Message-ID:  <CAF6rxg=QZvojrXQKBkT0f3CK_rZNF6Xm9A5Nnk2ivzPr67ysOA@mail.gmail.com>
In-Reply-To: <23181.50488.186767.579361@khavrinen.csail.mit.edu>
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> <20180221104400.GU94212@kib.kiev.ua> <23181.46427.671514.319710@khavrinen.csail.mit.edu> <20180221185920.GA94212@kib.kiev.ua> <23181.50488.186767.579361@khavrinen.csail.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 21 February 2018 at 11:15, Garrett Wollman <wollman@csail.mit.edu> wrote:
> <<On Wed, 21 Feb 2018 20:59:20 +0200, Konstantin Belousov <kostikbel@gmail.com> said:
>
>>> [I wrote:]
>>> Compliance with the 2001 POSIX standard (and subsequent versions).
>>>
>>> After C99, all POSIX interfaces that use pointers were updated to
>>> include the restrict qualifier where applicable.
>
>> Restrict barely puts any requirements on the implementation, but does on
>> the consumers.  Which is the cause of this discussion.
>
> I can't speak to this particular case, but my understanding is that
> "restrict" qualifier was only added to arguments if the behavior was
> already unspecified or undefined when the pointers in question were
> aliases (so the consumer was already broken if it did so).  Certainly
> such code has been broken for the better part of two decades.
>
>> Also, what incompliance consequences are ?  I am not even sure that the
>> prototype mismatch can be detected by means other than parsing the headers.
>
> It is permissible for an application to explicitly declare any
> function defined in the standard, so long as it uses the prototype set
> out in the standard.  Also, any vendor wanting POSIX or UNIX
> certification for a derivative system would have to fix it anyway.

Basically this: it is required by the standard. In addition glibc uses
this so its seems unlikely that any modern software will rely on
not-restrict.
https://github.com/bminor/glibc/blob/master/misc/sys/select.h#L101



-- 
Eitan Adler



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