httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Андрей Чернов <>
Subject Re: "locale" project
Date Fri, 19 Dec 1997 10:16:46 GMT
On Fri, 19 Dec 1997, Dean Gaudet wrote:

> I suspect there will be compiler warning issues because C library
> functions use naked "char".  The workaround will likely to be to use "gcc
> -funsigned-char -Wall", or whatever the equiv is on whatever other ANSI
> compiler we use.  Note that this is just a warning issue -- not
> necessarily a correctness issue.  (Although the library could be whacked.) 

It is the reason why "typedef ... uchar" is not really needed, because it
be backed by -funsigned-char in anycase as workaround of massive warnings.
-funsigned-char alone seems enough.

> A big worry here is that setlocale() is an expensive function.  On
> Solaris, for example, it involves reading a file off disk.  So we can't
> just switch locales at will.  It's unfortunate, but it's not possible for
> a POSIX program to exist in two locales at once.

One of the ways can be fork as many times as locales used and do all
locale-specific work in subprocesses.

> - (PR#754) struct tm does not include a time zone on all systems, we
> assume it does.  It's entirely possible that we'll need our own strftime() 
> replacement.

Oh, no! Apache already replaces too many standard functions. Is is time
now for Apache-libc? Lets do it only for systems which really needs them,
not for all systems as for snprintf f.e.

> - I'm certain we have assumptions that isalpha(c) is the same as c == 'a'
> || c == 'b' || ... || c == 'z' (and the upper case letters).  When in
> truth, isalpha(c) can also be true for various 8-bit characters in most
> non-"C" locales.  For example, in "ISO-8859-1", isalpha(192) is TRUE. 
> This has to be fixed. 

Unless we switch locale from "C", this assumption is true, but if we
switch somewhere, it is false. I don't think that Apache as daemon must
run itself under locale different than "C", but forked modules can switch
locale instead.

Andrey A. Chernov

View raw message