Word types..._(re)

Fri, 20 Jun 1997 12:30:05 +0100 (BST)


On Fri, 20 Jun 1997 01:08:29 +0200 (MET DST) Peter Gerwinski 
 wrote:

[...]
>    Int8    Word8 = Byte
>    Int16   Word16
>    Int32   Word32
>    Int64   Word64

I would vote for this.

[...]
>The other thing we must worry about is compatibility to GNU C, because
>the use of GNU Pascal depends on library written in GNU C.  For this reason,
>`ShortInt', `ShortWord', `ByteInt', and `Byte' must stay like they are;
>I think it's quite natural then to have `Word' for an unsigned 32-bit Integer.
>I am not sure whether `int' in GNU C might ever change to be different from
>`long int'.  (DOES SOMEBODY KNOW???)  If so, our (my;) choice for the meaning
>of `LongInt' and `LongWord' might be subject to change.  (Note again that
>I am speaking about types that *are* built-in in GPC with the mentioned
>meanings.)

Frankly speaking, I find the dissimilarities between GPC and GCC 
very confusing, and, at times, frustrating. Since GPC depends on
GCC, shouldn't the data structures be the same? For example, "long"
in GCC means "integer" in GPC, but "int" also means "integer". 
"Longint" in GPC is not the same as GCC's "long", which would seem
to be the sensible thing - but rather, it is the same as GCC's "long long".
"Word" seems to be 32-bit in GCC (am I right?), but  with the cygwin32 
port of GPC, "word" sometimes seems to be 16-bit,  and sometimes, 
32-bit (judging from all my attempts at wading through the thousands 
of lines of cygwin32 C headers - again, perhaps I am missing something,
but at least, I get very confused at times). 

It very soon  becomes a very difficult, or, at best, quite error-prone, 
task, to translate these C headers for use with GPC.

In my ideal world, GPC and GCC data types would follow this logical
course;

GCC			GPC
int			integer
short			shortint
word			word, cardinal
unsigned int		word, cardinal
unsigned short		shortword

long			longint  {now = integer}
unsigned long		longword  {now = word}
long long			comp  {now = longint, or comp}
unsigned long long		compword (now = longword}

This is perhaps only useful for easier translation of the GCC 
headers and therefore may not be a priority - however, I don't
think we will ever stop translating those C headers.

However, since the above will most likely break a lot of existing
code, perhaps GPC should have built-in data types that mean
*exactly* the same thing as they mean in GCC - e.g., "int",
"long", "short", etc (in addition to "integer", "longint", "shortint", etc).
This will certainly help in translating a lot of those .H files.

Any thoughts on these things?
	
Best regards, The Chief 
Dr Abimbola A. Olowofoyeku (The African Chief, and the Great Elephant)
Author of:  Chief's Installer Pro v3.60 for Win16 and Win32.
Homepage:  http://ourworld.compuserve.com/homepages/African_Chief/
E-mail: laa12@cc.keele.ac.uk



The African Chief (laa12@cc.keele.ac.uk)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es