Article View: gnu.g++.lib.bug
Article #198Bug in ctype.h for HP-UX 6.5
From: Darryl Okahata
Date: Wed, 29 Nov 1989 22:32
Date: Wed, 29 Nov 1989 22:32
42 lines
2305 bytes
2305 bytes
Piet van Oostrum writes:
> I tried to compile G++/LIBG++ (1.36.1) on HP-UX 6.5, with Darryl's patches.
> The ctype patch didn't work out on my system for two reasons:
>
> 1. The name is not _ctype, but __ctype on my system.
> 2. In contrast to other Unix systems the table has the first (superfluous)
> element missing, so all (_ctype_+1)'s should be __ctype.
>
> I don't know why this is different on my system, but the following works:
> I got the whole system running with the native assembler and loader.
[ Note: the following was originally determined by examination of
include and object (binary) files. It was not "determined" through
the use of any documentation or un*x source. ]
1. On HP-UX, "__ctype" is declared as:
extern unsigned char *__ctype;
This is a *POINTER* to the actual ctype array "_ctype" (and this
pointer also seems to point to the *second* element in the ctype
array, and not the first element).
2. Because the pointer "__ctype" points to the second element of the
array (index "1"), you do not, as you have discovered, need the
"(_ctype_+1)". However, as the patch that was originally distributed
uses the "_ctype" array and not the "__ctype" pointer, you do need
the "(_ctype_+1)".
I recommend using the original patch, as it does not require that
all the "(_ctype_+1)"s be changed to "__ctype". Also, referring to the
"_ctype" array is slightly faster than using an indirect pointer.
When you tried the original patch, why did it not work?
-- Darryl Okahata
UUCP: {hplabs!, hpcea!, hpfcla!} hpnmd!darrylo
Internet: darrylo%hpnmd@hpcea.HP.COM
DISCLAIMER: this message is the author's personal opinion and does not
constitute the support, opinion or policy of Hewlett-Packard or of the
little green men that have been following him all day.
Technical Details
Message-ID:
<8911292232.AA03648@hpsrdmo.HP.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HPSRDMO.HP.COM!darryloReferences:
<2113@ruuinf.cs.ruu.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!HPSRDMO.HP.COM!darrylo From: darrylo@HPSRDMO.HP.COM (Darryl Okahata) Newsgroups: gnu.g++.lib.bug Subject: Bug in ctype.h for HP-UX 6.5 Message-ID: <8911292232.AA03648@hpsrdmo.HP.COM> Date: 29 Nov 89 22:32:27 GMT References: <2113@ruuinf.cs.ruu.nl> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 42