Re: Implementation errors in strtol()

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Sat, 22 Jan 2005 01:11:57 +0300
On Fri, Jan 21, 2005 at 09:14:00PM +0100, Joerg Wunsch wrote:
> My point is: from a portability point of view, EINVAL is completely
> crap.  You can as well drop it.

It simple means we can't rely on portability as the reason for or opposite 
to this change.

> 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.
If we decide this change stay or not we can't rely on portability, all 
things are equal there. 

I repeat: portable application must always consider _both_ cases since 
both are mentioned in the standard as possible ones. Portable application 
can't stay with one variant only. Even if FreeBSD not implement "may" 
clause, some other system can do it at any moment. Moreover, portable 
application must consider non-POSIX conformant systems too, it additionly 
complicates subject.

Since we can't rely on portability, we can rely on practical reason to 
detect syntax errors which is hardly implemented by other methods (f.e. 
method you suggest can't detect overflows). Of course, such applications 
will be unportable per definition, but still POSIX conformant. We already 
have a lot of such things in our own codebase.

BTW, where was you when this change was discussed and commited by first 
time long ago? At those time I don't remember any "against" votes. All 
those times passed and nobody complain until this moment. It is good sign 
for this change to stay.

-- 
http://ache.pp.ru/
Received on Fri Jan 21 2005 - 21:12:00 UTC

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