tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strtonum(3) from OpenBSD?



On Wed, 24 Jun 2009 14:24:53 -0400
Thor Lancelot Simon <tls%rek.tjls.com@localhost> wrote:

> The function generates errno values which can't be used to
> distinguish the error cases distinguished by the text strings,
> which are (absurdly) specified in its manual page as part of the
> API (in other words, the function as specified is inherently
> non-localizable).
> 
> If it didn't set errno at all, it would be an example of really,
> really bad API design.  Since it does (but doesn't do so usefully),
> it's merely an example of bad API design.
> 
> This is NetBSD.  Cleanliness matters.  I'm opposed to adding this
> API to the system in its current form.
> 
I'd have phrased it differently, but I agree with Thor -- this is a bad
API.  Nor have I seen sufficient evidence that it's widely used in
software we might want to import.


                --Steve Bellovin, http://www.cs.columbia.edu/~smb


Home | Main Index | Thread Index | Old Index