From owner-freebsd-current@FreeBSD.ORG Sun Jan 23 22:16:34 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 AA5FB16A4CE for ; Sun, 23 Jan 2005 22:16:34 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDE5543D1D for ; Sun, 23 Jan 2005 22:16:33 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a185.otenet.gr [212.205.215.185]) j0NMGUEc006606; Mon, 24 Jan 2005 00:16:31 +0200 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id j0NMGUVk022405; Mon, 24 Jan 2005 00:16:30 +0200 (EET) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id j0NMGUxo022404; Mon, 24 Jan 2005 00:16:30 +0200 (EET) (envelope-from keramida@freebsd.org) Date: Mon, 24 Jan 2005 00:16:30 +0200 From: Giorgos Keramidas To: Andrey Chernov , Joerg Wunsch , current@freebsd.org Message-ID: <20050123221630.GB22234@gothmog.gr> References: <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> <20050122171743.GB39943@nagual.pp.ru> <20050123143024.GA28604@gothmog.gr> <20050123211656.GB64754@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050123211656.GB64754@nagual.pp.ru> 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: Sun, 23 Jan 2005 22:16:34 -0000 On 2005-01-24 00:16, Andrey Chernov wrote: >On Sun, Jan 23, 2005 at 04:30:24PM +0200, Giorgos Keramidas wrote: >> Why would checking for explicit errno values be necessary? IIRC, after >> a few emails I had exchanged with Dima Dorfman a few months ago, >> checking for endptr *and* errno != 0 was ok. > > _Portable_ application must suppose that not all OSes are POSIX > conformant, so it can't be sure what errno comes from strtol(), it is why > explicit checking for known value is needed. If errno is explicitly set (i.e. zeroed) by the calling program immediately before strtol(), can we not be sure that it was, in fact, strtol() that set it to any non-zero value?