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

From: Giles Lean <giles(at)nemeton(dot)com(dot)au>
To: shridhar_daithankar(at)persistent(dot)co(dot)in
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: contrib/fixchar (Was: Large databases, performance)
Date: 2002-10-11 22:54:48
Message-ID: 20829.1034376888@nemeton.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-10-11 23:07:04 Re: inline newNode()
Previous Message Mike Mascari 2002-10-11 22:38:44 Re: MySQL vs PostgreSQL.