From owner-svn-src-head@FreeBSD.ORG Tue Jun 5 13:09:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E97C106566B; Tue, 5 Jun 2012 13:09:24 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id E639D8FC1D; Tue, 5 Jun 2012 13:09:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q55D9MpJ014011; Tue, 5 Jun 2012 17:09:22 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q55D9MQe014010; Tue, 5 Jun 2012 17:09:22 +0400 (MSK) (envelope-from ache) Date: Tue, 5 Jun 2012 17:09:22 +0400 From: Andrey Chernov To: Pawel Jakub Dawidek Message-ID: <20120605130922.GE13306@vniz.net> Mail-Followup-To: Andrey Chernov , Pawel Jakub Dawidek , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG References: <201206042134.q54LYoVJ067685@svn.freebsd.org> <20120605074741.GA1391@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gj572EiMnwbLXET9" Content-Disposition: inline In-Reply-To: <20120605074741.GA1391@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG Subject: Re: svn commit: r236582 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jun 2012 13:09:24 -0000 --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 05, 2012 at 09:47:42AM +0200, Pawel Jakub Dawidek wrote: > > "The setting of errno after a successful call to a function is > > unspecified unless the description of that function specifies that > > errno shall not be modified." >=20 > Very interesting. However free(3) is always successful. Maybe we need > more context here, but the sentence above might talk about functions > that can either succeed or fail and such functions do set errno on > failure, but we don't know what they do to errno on success - they > sometimes interact with the errno, free(3) never does. According to Austing Group interpretation, this setence talks about=20 funtions which always succeed too, please see http://austingroupbugs.net/view.php?id=3D385 > I aware that my interpretation might be too wishful, but it is pretty > obvious to save errno value when calling a function that can eventually > fail - when we save the errno we don't know if it will fail or not, so > we have to do that, but requiring to save errno when calling a void > function that can't fail is simply silly and complicates the code > without a reason. It still can fail due to internal errors, it just not returns failure. For internal errors POSIX states that errno state is unspecified. > I agree that the standards aren't clear, but if saving errno around > free(3) is the way to go, then I'm sure we have much more problems in > our code, even if it is not suppose to be portable it should be correct > - we never know who and when will take the code and port it. Currently they are pretty clear in that moment, although I agree that if=20 POSIX says it should not modify errno, the life will be easy. Lets look at= =20 their further movement, since they are already aware of this specific=20 problem. > I guess what I'm trying to say here is that this is much bigger change > than it looks and we should probably agree on some global rule here. =2E..which not violate standards. --=20 http://ache.vniz.net/ --gj572EiMnwbLXET9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/OBQIACgkQVg5YK5ZEdN3tRwCfSZV9vBpAGgmbFiu6NQuciGF1 ussAn3c6HZUcV5JLevuVuJGCnrw/PpBI =sd4B -----END PGP SIGNATURE----- --gj572EiMnwbLXET9--