This is the mail archive of the
mailing list for the glibc project.
Re: Inline function definitions for isdigit and isxdigit?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 15 Sep 2016 18:02:52 +0000
- Subject: Re: Inline function definitions for isdigit and isxdigit?
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On Thu, 15 Sep 2016, Florian Weimer wrote:
> Can we provide inline definitions for isdigit and xdigit?
> POSIX says (for the digit character class):
> In a locale definition file, only the digits <zero>, <one>, <two>, <three>,
> <four>, <five>, <six>, <seven>, <eight>, and <nine> shall be specified, and in
> contiguous ascending sequence by numerical value. The digits <zero> to <nine>
> of the portable character set are automatically included in this class.
> This means it's fixed to '0' .. '9' for our purposes (our locales must be
> ASCII-transparent at least as far as the digits are concerned).
localedef should then disallow charmap files that aren't ASCII-transparent
for digits, if it doesn't already.
> For xdigit, one can have more than two sequences of 'A' .. 'F' letters:
> In a locale definition file, only the characters defined for the class digit
> shall be specified, in contiguous ascending sequence by numerical value,
> followed by one or more sets of six characters representing the hexadecimal
> digits 10 to 15 inclusive, with each set in ascending order (for example, <A>,
> <B>, <C>, <D>, <E>, <F>, <a>, <b>, <c>, <d>, <e>, <f>).
> But I wonder how useful this is in practice. One might be tempted to define
It seems perfectly valid in accordance with POSIX, and we support users
defining locales, so can't restrict functions to what's valid only for the
locales shipped with glibc (whereas support for alternative charmaps is
implementation-defined, so we can limit what we allow in charmap files).
Joseph S. Myers