* [9fans] no error checking in strtol and strtoul
@ 2003-02-24 10:00 Saroj Mahapatra
2003-02-24 19:41 ` rob pike, esq.
0 siblings, 1 reply; 2+ messages in thread
From: Saroj Mahapatra @ 2003-02-24 10:00 UTC (permalink / raw)
To: 9fans
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [9fans] no error checking in strtol and strtoul
2003-02-24 10:00 [9fans] no error checking in strtol and strtoul Saroj Mahapatra
@ 2003-02-24 19:41 ` rob pike, esq.
0 siblings, 0 replies; 2+ messages in thread
From: rob pike, esq. @ 2003-02-24 19:41 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
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
[-- Attachment #2: Type: message/rfc822, Size: 2108 bytes --]
From: Saroj Mahapatra <saroj@optonline.net>
To: 9fans@cse.psu.edu
Subject: [9fans] no error checking in strtol and strtoul
Date: Mon, 24 Feb 2003 10:00:21 GMT
Message-ID: <6d3220b4.0302221730.6677da7@posting.google.com>
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-02-24 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-24 10:00 [9fans] no error checking in strtol and strtoul Saroj Mahapatra
2003-02-24 19:41 ` rob pike, esq.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).