Implementation errors in strtol()
Thomas Dickey
dickey at radix.net
Sat Jan 22 04:40:35 PST 2005
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20050122/513d8470/attachment.bin
More information about the freebsd-current
mailing list