This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: strtoul etc.
- To: Nathan Myers <ncm@cantrip.org>
- Subject: Re: strtoul etc.
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 06 May 1999 11:19:35 -0700
- Cc: libstdc++@sourceware.cygnus.com
- References: <E10fSRf-0000ih-00@localhost>
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
Nathan Myers <ncm@cantrip.org> writes:
> Using the strtoul() family for conversion is just wrong.
It's not. It's memory efficient and fast. Note that the base
parameter is not 0.
If you implemented strtoll etc *fast* you'd know how much work it is.
> While filling the buffer to pass to strtoul, you have already
> done all of its work except for the most trivial part -- a
> multiply-and-add.
See. You don't even see the real problem.
> Furthermore, the C functions do not detect overflow, where C++ is
> required to detect and report overflow and similar errors, so
> besides being slower, it's wrong.
Of course strtol & friends detect overflows.
--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------