pointer-compatibile integers_(re)

Fri, 1 Aug 1997 20:37:57 +0200 (MET DST)


According to Frank Heckenbach:
> 
> Can there be any problems with signedness, or is it guaranteed that
> ptrdiff_t is always signed and of the same size as a pointer? (I should
> think so, but after all I've heard in the last time about such things,
> I'm getting very careful...) If this is portable, there's no need to
> predefine this type.

Of course, this is *not* guaranteed.

> What about size_t?
> [...]
> So perhaps only one more integer type (for now)... :-)

GNU C has two special types here:  SIZE_TYPE and PTR_DIFF_TYPE.  Both are
machine-dependent.  To be compatible, maybe we must provide both?
Following the notations for required identifiers in the Extended Pascal
standard, we should not use underscores for predefined types.  So what
about `SizeType' and `PtrDiffType'?

Since both are *not* guaranteed to have the same size as a pointer, the
other thing, `Ptr[Int|Card|Word]', would be useful, too.  This means
five more integer types.

More suggestions?

Greetings,

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

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