Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, t-ishii(at)sra(dot)co(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date: 2000-09-17 18:56:09
Message-ID: Pine.GSO.3.96.SK.1000917214827.26064e-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)sss(dot)pgh(dot)pa(dot)us>
> To: Peter Eisentraut <peter_e(at)gmx(dot)net>
> Cc: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>, pgsql-hackers(at)postgresql(dot)org
> Subject: Re: [HACKERS] broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
>
> Peter Eisentraut <peter_e(at)gmx(dot)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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2000-09-17 19:52:12 Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Previous Message Tom Lane 2000-09-17 18:46:35 Re: Constant propagation and similar issues