From owner-freebsd-current@FreeBSD.ORG Sat Jan 22 17:20:02 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A3A1816A4CF for ; Sat, 22 Jan 2005 17:20:02 +0000 (GMT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD4B143D46 for ; Sat, 22 Jan 2005 17:20:01 +0000 (GMT) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.13.1/8.13.1) with ESMTP id j0MHK03f040535; Sat, 22 Jan 2005 20:20:00 +0300 (MSK) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.13.1/8.13.1/Submit) id j0MHK0Ow040534; Sat, 22 Jan 2005 20:20:00 +0300 (MSK) (envelope-from ache) Date: Sat, 22 Jan 2005 20:20:00 +0300 From: Andrey Chernov To: Thomas Dickey Message-ID: <20050122172000.GC39943@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Thomas Dickey , current@FreeBSD.ORG References: <20050121201400.GQ30862@uriah.heep.sax.de> <20050121221156.GA21459@nagual.pp.ru> <20050120192324.GA30862@uriah.heep.sax.de> <20050120205501.GA69123@nagual.pp.ru> <20050120211449.GC30862@uriah.heep.sax.de> <20050120214406.GA70088@nagual.pp.ru> <20050120222137.GE30862@uriah.heep.sax.de> <20050121230949.GA34313@VARK.MIT.EDU> <20050122113015.GV30862@uriah.heep.sax.de> <20050122124032.GA26006@saltmine.radix.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <20050122124032.GA26006@saltmine.radix.net> User-Agent: Mutt/1.5.6i X-AntiVirus: checked by AntiVir Milter (version: 1.1.0-3; AVE: 6.29.0.8; VDF: 6.29.0.75; host: nagual.pp.ru) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (nagual.pp.ru [0.0.0.0]); Sat, 22 Jan 2005 20:20:00 +0300 (MSK) cc: current@FreeBSD.ORG Subject: Re: Implementation errors in strtol() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jan 2005 17:20:02 -0000 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 22, 2005 at 07:40:33AM -0500, Thomas Dickey wrote: > > Nope. Just think about it: code which doesn't take this feature into > > account needs to check for conversion errors by means of verifying > > endptr. It simply wouldn't care about errno at all, except for > > That's what I always do - that's the way strtol was first documented. > Adding errno tweaks on top of that is (as noted) neither portable nor > necessary. The story not ends here. After checking endptr you should check for overflow, and there you need to consider both cases. See my detailed reply to Joerg. -- http://ache.pp.ru/ --ZGiS0Q5IWpPtfppv Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iQCVAwUBQfKLQOJgpPLZnQjrAQGF1QP/TXhEOwTp9IKWk4rMfdy87/Dbdaoz5mIv nwVOb9irlGcOP6VCBqpUo9asGleV5kVPXaENzliNR+ifwVsG2f8WM76AwhWAWzxX 26u8miXSXl7DP5r170muCft2NakM3AdtHBXV90h9uCy3Q+8EjSAcFnQ9zIXKgXmn mPS9QOyZ5es= =PQbv -----END PGP SIGNATURE----- --ZGiS0Q5IWpPtfppv--