Well,
with the help of Tatsuo I found the problem is in backend/regex/regcomp.c
I'll look for more details and probably could make a fix.
quick question: is there in sources locale-aware strncmp function
or I need to write myself ?
As for the compiler option I think we should'nt use any
"-funsigned-chars" like options !
Regards,
Oleg
On Sun, 17 Sep 2000, Tom Lane wrote:
> Date: Sun, 17 Sep 2000 13:48:37 -0400
> From: Tom Lane <tgl@sss.pgh.pa.us>
> To: Peter Eisentraut <peter_e@gmx.net>
> Cc: Oleg Bartunov <oleg@sai.msu.su>, pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
>
> Peter Eisentraut <peter_e@gmx.net> writes:
> > I think that the problem might rather be that lower_text (and various
> > other arrays) are not declared as unsigned char in the first place. That
> > would also explain why -funsigned-chars fixes it. Because calling
> > toupper() etc. with a signed char argument is in violation of the spec.
>
> Well, we could fix it either by propagating use of "unsigned char" all
> over the place, or by casting the arguments given to ctype macros.
> The former would be a lot more invasive because it would propagate to
> routines that don't actually call any ctype macros (since they'd have
> to conform to prototypes, struct definitions, etc). So I'm inclined to
> go with the latter. A quick search-and-replace scan ought to do it.
>
> Also, on machines where the ctype macros actually are implemented as
> array lookups, gcc -Wall should warn about any calls we miss, so as
> long as someone is paying attention on such a platform, we don't have
> to worry about the problem sneaking back in.
>
> > (Hmm, template/aix contains this: CFLAGS='-qchars=signed ...'. That can't
> > be good.)
>
> Probably Andreas put that in --- maybe he still remembers why. But it
> shouldn't matter. We need to be able to run on platforms where char is
> signed and there's no handy "-funsigned-chars" compiler option.
>
> regards, tom lane
>
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83