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

From Peter Eisentraut
Subject Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?
Date
Msg-id Pine.LNX.4.21.0009180013270.576-100000@peter
Whole thread Raw
In response to Re: broken locale in 7.0.2 without multibyte support (FreeBSD 4.1-RELEASE) ?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> 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).

I'm not married to either solution, I just opine that it is cleaner to use
"signed char" and "unsigned char" explicitly when you depend on the
signed-ness. Otherwise you might just end up moving the problem elsewhere,
namely those structs and prototypes, etc.

> > (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.

What I meant was that

(a) according to Oleg's report, the source depends on char being unsigned
in some places, so those places break on AIX, and

(b) according to the above, the source apparently requires char to be
signed in some places, so it breaks when char is made unsigned.

*That* can't be good.


-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Constant propagation and similar issues
Next
From: Hannu Krosing
Date:
Subject: Re: Notice and share memory corruption