From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] no error checking in strtol and strtoul From: "rob pike, esq." In-Reply-To: <6d3220b4.0302221730.6677da7@posting.google.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-tkemoxgmpwoimhgslcxhtjthlc" Date: Mon, 24 Feb 2003 11:41:18 -0800 Topicbox-Message-UUID: 70cb392a-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-tkemoxgmpwoimhgslcxhtjthlc Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Please be more specific. I just read the spec and, within the constraints of a different model (no errno), the Plan 9 routines seem to handle overflow fine. If you're asking why it doesn't set errstr, well, it could and that's probably just an oversight. -rob --upas-tkemoxgmpwoimhgslcxhtjthlc Content-Type: message/rfc822 Content-Disposition: inline Return-Path: <9fans-admin@cse.psu.edu> Received: from killy.mspring.net ([207.69.231.40] verified) by mail.mightycheese.com (CommuniGate Pro SMTP 3.4.7) with ESMTP-TLS id 501851 for rob@mail.mightycheese.com; Mon, 24 Feb 2003 04:12:23 -0600 Received: from mail.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by killy.mspring.net (8.12.5/8.8.6) with ESMTP id h1OACLXg092770 for ; Mon, 24 Feb 2003 05:12:21 -0500 (EST) Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.4.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 5088619A2D; Mon, 24 Feb 2003 05:12:15 -0500 (EST) Delivered-To: 9fans@cse.psu.edu Received: from mercury.bath.ac.uk (mercury.bath.ac.uk [138.38.32.81]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id B127619A31 for <9fans@cse.psu.edu>; Mon, 24 Feb 2003 05:11:14 -0500 (EST) Received: from news by mercury.bath.ac.uk with local (Exim 3.12 #1) id 18nFPO-0006Et-00 for 9fans@cse.psu.edu; Mon, 24 Feb 2003 10:00:26 +0000 Received: from GATEWAY by bath.ac.uk with netnews for 9fans@cse.psu.edu (9fans@cse.psu.edu) To: 9fans@cse.psu.edu From: Saroj Mahapatra Message-ID: <6d3220b4.0302221730.6677da7@posting.google.com> Organization: http://groups.google.com/ Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: [9fans] no error checking in strtol and strtoul Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Mon, 24 Feb 2003 10:00:21 GMT Hi, Was the decision to leave out error checking (like ANSI C strtol and strtoul do) deliberate? The first type of error (wrong syntax) is easy to check (if ret value == 0 and rest == beginning of string), but not handling overflow situation is unsatisfactory. I'd like to hear plan 9 implementators' comment on this. Thanks, Saroj Mahapatra --upas-tkemoxgmpwoimhgslcxhtjthlc--