From owner-freebsd-standards@freebsd.org Wed Feb 21 20:10:18 2018 Return-Path: Delivered-To: freebsd-standards@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 7C69EF261E5 for ; Wed, 21 Feb 2018 20:10:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5F39701E9 for ; Wed, 21 Feb 2018 20:10:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w1LKA3TF012844 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 21 Feb 2018 22:10:06 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w1LKA3TF012844 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w1LKA2L7012835; Wed, 21 Feb 2018 22:10:02 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 21 Feb 2018 22:10:02 +0200 From: Konstantin Belousov To: Garrett Wollman Cc: freebsd-standards@freebsd.org Subject: Re: Marking select(2) as restrict Message-ID: <20180221201002.GC94212@kib.kiev.ua> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23181.50488.186767.579361@khavrinen.csail.mit.edu> User-Agent: Mutt/1.9.3 (2018-01-21) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 20:10:18 -0000 On Wed, Feb 21, 2018 at 02:15:04PM -0500, Garrett Wollman wrote: > < 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. Undefined != broken, whatever some compiler vendors try to bluff. > > > 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. For such vendors, backward compatibility with existing software should have different priorities than for us. We need a useful software runnable on the system first, and blue sky stuff like POSIX compliance second.