From owner-freebsd-current@FreeBSD.ORG Fri Jan 21 20:20:08 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 E47AD16A4CE for ; Fri, 21 Jan 2005 20:20:07 +0000 (GMT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 135BB43D41 for ; Fri, 21 Jan 2005 20:20:07 +0000 (GMT) (envelope-from j@uriah.heep.sax.de) Received: from sax.sax.de (localhost [127.0.0.1]) by sax.sax.de (8.12.10/8.12.10) with ESMTP id j0LKK5Yu022614; Fri, 21 Jan 2005 21:20:05 +0100 (CET) (envelope-from j@uriah.heep.sax.de) Received: (from uucp@localhost) by sax.sax.de (8.12.10/8.12.10/Submit) with UUCP id j0LKK5oo022613; Fri, 21 Jan 2005 21:20:05 +0100 (CET) (envelope-from j@uriah.heep.sax.de) Received: from uriah.heep.sax.de (localhost [127.0.0.1]) by uriah.heep.sax.de (8.13.1/8.13.1) with ESMTP id j0LKE0jm004563; Fri, 21 Jan 2005 21:14:00 +0100 (MET) (envelope-from j@uriah.heep.sax.de) Received: (from j@localhost) by uriah.heep.sax.de (8.13.1/8.13.1/Submit) id j0LKE0v0004562; Fri, 21 Jan 2005 21:14:00 +0100 (MET) (envelope-from j) Date: Fri, 21 Jan 2005 21:14:00 +0100 From: Joerg Wunsch To: current@freebsd.org Message-ID: <20050121201400.GQ30862@uriah.heep.sax.de> 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> <20050121000916.GA73235@nagual.pp.ru> <20050121125801.GA94152@nagual.pp.ru> <20050121144428.GK30862@uriah.heep.sax.de> <20050121194103.GB19150@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050121194103.GB19150@nagual.pp.ru> User-Agent: Mutt/1.4.2.1i X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-GPG-Fingerprint: 5E84 F980 C3CA FD4B B584 1070 F48C A81B 69A8 5873 X-Spam-Status: No, score=-2.6 required=7.5 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on uriah.heep.sax.de cc: Andrey Chernov Subject: Re: Implementation errors in strtol() X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joerg Wunsch List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2005 20:20:08 -0000 As Andrey Chernov wrote: > > Btw., Solaris never sets errno to EINVAL except for the > > unacceptable base case (where SUSP requires it). > This is _recent_ "Extension to the ISO C standard" as POSIX/SUSv3 > names it. No wonder that some systems with old code base not > implement it yet. Solaris is anything else but an ``old code base'', and it's not all that recent, as SUSPv2 is many years old. > Also see about "may" words tendency at the end of the message. Sure, that's why I think the entire EINVAL issue is quite pointless. As long as an application ``may'' support it, there's no guarantee about it, thus a conformant application cannot rely on it, and is forced to have their own validity checks. This defeats the entire idea behind setting errno to EINVAL completely. (This is made even worse in that many systems simply quote the SUSP man page as their system's man page, including the `may', so you cannot even be sure about their particular behaviour by reading their docs. This applies to both, Linux and Solaris.) > Portability is another subject there. From portability point of view > there is no difference, ... My point is: from a portability point of view, EINVAL is completely crap. You can as well drop it. > There is tendence in POSIX standards showing for years. What is > "may" in first edition becomes "must" after few years. IMHO it will > be better to keep the system already prepared. I still disagree. This hasn't been changed over years, as the line from Posix to SUSPv2 through SUSPv3 shows. Well, according to Bruce it's even been just the opposite in the first Posix drafts, where EINVAL was required for conversion errors and optional for bad values of base, so you could infer that they are phasing the feature out instead of in. ;-) Do whatever you want, I think it's silly and should rather be dropped as it is a useless feature, which could only lead people to write unportable code. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)