From owner-freebsd-hackers@freebsd.org Sun Feb 25 14:47:03 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82933F31585 for ; Sun, 25 Feb 2018 14:47:03 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic307-9.consmr.mail.gq1.yahoo.com (sonic307-9.consmr.mail.gq1.yahoo.com [98.137.64.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F39737F678 for ; Sun, 25 Feb 2018 14:47:02 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: aeiaDq4VM1n0FoQTDuAiG9hKIOA3Oc1AkBzmbJ8nYGjSD0RhiAH.iWCxMjX43SL zqrX3ha8eDwnfekZAaQGGGGk9r53tg_8tP4E2n1HxkRL6IY_4M09N337lpwBwCPvNjw4YzvP.PUE KbmrFccV6Rot4slpok2VgkbjUCrvvC4FeyY3SL4TvkNJ6me05tiuXIiyofCR4sCeJnJ8jPQICMdn Z4EZYlKBtZTHPaX449G0SxlKAMj5GRMUXdRlwyEkZAxT4z0xngY0hLCY6zudmB7h.fMviVT9R1lP koXGSMjti0VKD4p4W7NoQgeycoVSCXM_zuDzukwmUIhmVnjkJ7towfyczyyAC3.iEcFh8nRB8CA2 MejPULuFkwh.ezAneYp8xQ2abFG0_pXaQtForqoX_FRJkuACRp0iRSrCB9z.xDg8q1tVvxgMK7y0 MvPtKIGfZLmcA7GAUjo_6.0XMxgqFRrtOy9scTLJZeNaa_4vLGb_cEwV7MfL4QI4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.gq1.yahoo.com with HTTP; Sun, 25 Feb 2018 14:46:56 +0000 Received: from smtp101.rhel.mail.gq1.yahoo.com (EHLO [192.168.1.25]) ([68.180.227.10]) by smtp413.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID e97702b39406288e9e6deaaf59d87a7d; Sun, 25 Feb 2018 14:46:53 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: Marking select(2) as restrict From: Mark Millard In-Reply-To: <20180225112627.B976@besplex.bde.org> Date: Sun, 25 Feb 2018 06:46:52 -0800 Cc: Warner Losh , FreeBSD Hackers , FreeBSD Standards , "Conrad E. Meyer" Content-Transfer-Encoding: 7bit Message-Id: <5957DA7A-80CC-48D8-AC4B-8EC403658AC2@yahoo.com> References: <20180221032247.GA81670@ns.kevlo.org> <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> <20180225112627.B976@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2018 14:47:03 -0000 On 2018-Feb-24, at 5:28 PM, Bruce Evans wrote: > On Sat, 24 Feb 2018, Warner Losh wrote: > >> On Sat, Feb 24, 2018 at 11:55 AM, Conrad Meyer wrote: >> >>> On Sat, Feb 24, 2018 at 10:35 AM, Eitan Adler >>> 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)