Re: contrib/fixchar (Was: Large databases, performance)

Поиск
Список
Период
Сортировка
От Giles Lean
Тема Re: contrib/fixchar (Was: Large databases, performance)
Дата
Msg-id 20829.1034376888@nemeton.com.au
обсуждение исходный текст
Ответ на Re: contrib/fixchar (Was: Large databases, performance)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Ответы Re: contrib/fixchar (Was: Large databases, performance)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: contrib/fixchar (Was: Large databases, performance)  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Список pgsql-hackers
> Well, this is not related to postgresql exactly but to summerise the
> problem, with libc patch PHCO_19090 or compatible upwards, on
> HP-UX11, isspace does not work correctly if input value is >127.

o isspace() and such are defined in the standards to operate on characters
o for historic C reasons, 'char' is widened to 'int' in function calls
o it is platform dependent whether 'char' is a signed or unsigned type

If your platform has signed 'char' (as HP-UX does on PA-RISC) and you
pass a value that is negative it will be sign extended when converted
to 'int', and may be outside the range of values for which isspace()
is defined.

Portable code uses 'unsigned char' when using ctype.h features, even
though for many platforms where 'char' is an unsigned type it's not
necessary for correct functioning.

I don't see any isspace() or similar in the code though, so I'm not
sure why this issue is being raised?

Regards,

Giles


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mike Mascari
Дата:
Сообщение: Re: MySQL vs PostgreSQL.
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: MySQL vs PostgreSQL.