Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2001 18:14:26 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        "Andrey A. Chernov" <ache@FreeBSD.org>, <cvs-all@FreeBSD.org>, <cvs-committers@FreeBSD.org>
Subject:   RE: cvs commit: src/lib/libc/stdlib strtol.c strtoll.c strtoq.c
Message-ID:  <20011128180345.C2034-100000@gamplex.bde.org>
In-Reply-To: <XFMail.011127165507.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 27 Nov 2001, John Baldwin wrote:

> On 28-Nov-01 Andrey A. Chernov wrote:
> > ache        2001/11/27 16:48:11 PST
> >
> >   Modified files:
> >     lib/libc/stdlib      strtol.c strtoll.c strtoq.c strtoul.c
> >                          strtoull.c strtouq.c
> >   Log:
> >   Understand national (non-ASCII) digits now
> >   Allow bases >=36 again
> >   Misc cleanup
>
> Does this break C89?  According to the manpage:

This partly unbreaks C90.  Negative bases are still not supported AFAIK
(I haven't looked at the commit, but I discussed supporting them and
thought they weren't worth supporting since supporting them would require
nontrivial changes).

> STANDARDS
>      The strtol() function conforms to ISO/IEC 9899:1990 (``ISO C89'').  The
>      strtoll() function conforms to ISO/IEC 9899:1999 (``ISO C99'').  The BSD
>      strtoq() function is deprecated.
>
> and:
>
> ERRORS
>      [EINVAL]           The value of base is not supported or no conversion
>                         could be performed.
>
> Does C99 support more than base 36 and if so should the manpage be updated?

C99 is the same as C90, at least in the n869 draft.  It requires supporting
all bases.

The man page should be downdated.  EINVAL is only a specified error code
for POSIX-1-200x.

I guess weird bases could be handled correctly for C90 by not recognizing
any characters if the base is weird.  Just use the old error handling for
this and don't set errno.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011128180345.C2034-100000>