From owner-freebsd-current@FreeBSD.ORG Thu Jan 20 22:40:40 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 C512716A4CF; Thu, 20 Jan 2005 22:40:40 +0000 (GMT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD66F43D53; Thu, 20 Jan 2005 22:40:19 +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 j0KMeIPD071723; Fri, 21 Jan 2005 01:40:18 +0300 (MSK) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.13.1/8.13.1/Submit) id j0KMeIEO071722; Fri, 21 Jan 2005 01:40:18 +0300 (MSK) (envelope-from ache) Date: Fri, 21 Jan 2005 01:40:18 +0300 From: Andrey Chernov To: Joerg Wunsch Message-ID: <20050120224017.GA71573@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Joerg Wunsch , current@FreeBSD.ORG, bde@FreeBSD.ORG 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050120222137.GE30862@uriah.heep.sax.de> 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.73; host: nagual.pp.ru) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (nagual.pp.ru [0.0.0.0]); Fri, 21 Jan 2005 01:40:18 +0300 (MSK) cc: current@FreeBSD.ORG cc: bde@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: Thu, 20 Jan 2005 22:40:41 -0000 On Thu, Jan 20, 2005 at 11:21:37PM +0100, Joerg Wunsch wrote: > Nope. "0" alone is a completely valid hexadecimal number, > representing the value 0. Conversion has to start at the 0 (as it is I agree with you in this part, see my patch with POSIX quote. > > +- may produce EINVAL, as POSIX says. > > Where? 1) "If the subject sequence is empty or does not have the expected form, no conversion is performed;" 2) "If no conversion could be performed, 0 shall be returned and errno may be set to [EINVAL]." All "expected forms" (integer, octal, hex, other bases constants) are perfectly described at the start and +- alone is not among them. > Again, I'd value the C standard higher than Posix. C says they form a > valid subject sequence. Thus, no error may be flagged. But FreeBSD always tends to follow POSIX as final judge. At least in the past... > I don't have Posix at hand, but SUSPv2 completely follows the C You can download free PDF copy at their site, just register there. > This is no excuse for violating standards. If a user feels that a This is just their intehtions explanation, not excuse. If several standards are in contradiction, POSIX vote is final. It may surprise you, but it covers and changes lots of cases comparing to minimalistic C standard. Such additions/changes are specially marked with different color (gray). -- http://ache.pp.ru/