<<< Date Index >>>     <<< Thread Index >>>

Re: [PATCH] warning cleared



On 2005-09-21 22:27:04 +0100, David Laight wrote:
> Since isdigit() is locale dependent, it does rather beg the question
> as to what code like:
>       if (isdigit(x)) n = n * 10 + (x - '0');
> if a locale defines anything other than '0'..'9' as digits!

I don't think it is locale-dependent. The ISO C99 standard says:

    [#2]  The  isdigit  function  tests  for  any  decimal-digit
    character (as defined in 5.2.1).

The decimal digits defined in 5.2.1 are those of the basic character
sets; thus there are not locale-dependent.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA