tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: strtonum(3) from OpenBSD?
On Tue, Jun 23, 2009 at 11:50:18AM -0500, David Young wrote:
> On Tue, Jun 23, 2009 at 05:35:04PM +0200, Martin Husemann wrote:
> > On Tue, Jun 23, 2009 at 11:29:56AM -0400, Thor Lancelot Simon wrote:
> > > Returning an error *string* is so profoundly bogus I have trouble
> > > imagining that anyone with more than a few weeks' experience programming
> > > in C doesn't see why.
> >
> > Indeed, but if we change it to a better API it will imediately loose
> > it's portability value.
>
> Right.
>
> What if we write strtonum(3) in terms of an API that we do like, and
> indicate in the manual page that strtonum(3) should not be used for new
> code?
Sure, we could do that. We could also cause every string returned by
strtonum(3) to be "USELESS ERROR STRING -- SEE ERRNO", since the function
does set errno, and document that our implementation does so. But I
still don't see how this justifies adding this bogus interface to libc.
Thor
Home |
Main Index |
Thread Index |
Old Index