Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 06:46:52 -0800
From:      Mark Millard <marklmi26-fbsd@yahoo.com>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Warner Losh <imp@bsdimp.com>, FreeBSD Hackers <freebsd-hackers@freebsd.org>, FreeBSD Standards <freebsd-standards@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org>
Subject:   Re: Marking select(2) as restrict
Message-ID:  <5957DA7A-80CC-48D8-AC4B-8EC403658AC2@yahoo.com>
In-Reply-To: <20180225112627.B976@besplex.bde.org>
References:  <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> <20180221201002.GC94212@kib.kiev.ua> <23181.54825.511195.393054@khavrinen.csail.mit.edu> <20180222212746.GB58772@stack.nl> <CAF6rxgkW=Fgh4%2B1-aJG=VUCYso9gcKnER17UOiBy8GtTMsJNYQ@mail.gmail.com> <CAF6rxg=-nBz8caa1Wn1Labn3DydpEO6B8W9PaLhNKYFwGvuZxw@mail.gmail.com> <CAG6CVpV-YBfGsh5zDRuB7N43N4FW5X69BDyi_XF21fs7tOr5JQ@mail.gmail.com> <CANCZdfpmB2KEfORKhsC9=AK0KP2z2_A=LC0YeZrFZv-8MEgT=g@mail.gmail.com> <20180225112627.B976@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2018-Feb-24, at 5:28 PM, Bruce Evans <brde@optusnet.com.au> wrote:

> On Sat, 24 Feb 2018, Warner Losh wrote:
> 
>> On Sat, Feb 24, 2018 at 11:55 AM, Conrad Meyer <cem@freebsd.org> wrote:
>> 
>>> On Sat, Feb 24, 2018 at 10:35 AM, Eitan Adler <lists@eitanadler.com>
>>> wrote:
>>>> After this entire thread here is the summary. If I've misrepresented
>>>> you here please let me know.
>>>> ...
>>>> 
>>>> kib@ - no benefit; concerned fallout could be hard to observe
>>>> cem@ - concerned about warnings
>>> 
>>> Consider me a +1 to kib@.  I did not voice those concerns explicitly
>>> in earlier email because kib did already and I didn't anticipate you
>>> would ignore him.
>> 
>> So there's no benefit to the change (we won't optimize better). It's hard
>> to observe breakage. No answer about how we'd even know if something broke
>> because a exp run sure as hell isn't going to tell us.
>> 
>> All that militates against the change rather strongly. Your exp run will
>> change no minds because it is useless.
> 
> Why not remove restrict from other APIs to be consistent with select()?  If
> might break their callers just as much.

This appears to be about the handling of non-conforming programs. Quoting
from C99's 6.7.3 "Type qualifiers" paragraph 7 about conforming programs:

"The intended use of the restrict qualifier (like the register storage
class) is to promote optimization, and deleting all instances of the
qualifier from all preprocessing units composing a conforming program
does not change its meaning (i.e. observable behavior)."

So: If removing restrict results in a conforming program's observable
behavior changing, then that would be evidence that the environment is
incorrectly implemented relative to C99.

Of course, removing restrict can make it harder to detect non-conforming
programs if the compiler(s) involved are helpful when restrict is
present.


Going the other way:

6.7.3.1 "Formal definition of restrict" also says in its paragraph 6:

"A translator is free to ignore any or all aliasing implications of
uses of restrict."

===
Mark Millard
marklmi at yahoo.com
( markmi at dsl-only.net is
going away in 2018-Feb, late)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5957DA7A-80CC-48D8-AC4B-8EC403658AC2>