tech-userlevel archive

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

Re: [PATCH] strto*l() nonstandard behaviour fix



On Tue, Aug 19, 2008 at 07:08:29PM +0300, Andy Shevchenko wrote:
> On Tue, Aug 19, 2008 at 7:06 PM, Andy Shevchenko
> <andy.shevchenko%gmail.com@localhost> wrote:
> >> Draft of this document I have at hand does not prescribe any particular
> >> behaviour for base outside its range.
> And, please, write here the reasonable "digit" for base from 37..X.

Well, in the document I read [1], it is said that in locales other than
C and POSIX, other subject sequences may be accepted, which opens the
door for a larger base.

That said, our man page explicitely says the base should be 0, or 2 to
36 inclusive, so we should return EINVAL in other cases.  I don't think
the case base == 1 suffers any contestation at least.  As for the rest,
I don't see any point in supporting it, and the spec permits us to
return EINVAL, and so shall we do it.

[1] http://www.opengroup.org/onlinepubs/000095399/functions/strtoul.html

-- 
Quentin Garnier - cube%cubidou.net@localhost - cube%NetBSD.org@localhost
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Attachment: pgpT4ai11Ikc9.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index