Re: Implementation errors in strtol()

From: Thomas Dickey <dickey_at_radix.net>
Date: Sat, 22 Jan 2005 07:40:33 -0500
On Sat, Jan 22, 2005 at 12:30:15PM +0100, Joerg Wunsch wrote:
> As Andrey Chernov wrote:
> 
> > > 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.
> 
> > The code which _not_ expect this feature present is _equally_
> > unportable.
> 
> Nope.  Just think about it: code which doesn't take this feature into
> account needs to check for conversion errors by means of verifying
> endptr.  It simply wouldn't care about errno at all, except for

That's what I always do - that's the way strtol was first documented.
Adding errno tweaks on top of that is (as noted) neither portable nor
necessary.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net

Received on Sat Jan 22 2005 - 11:40:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC