[fpc-pascal] History of the Cardinal data type?

Marco van de Voort marcov at stack.nl
Tue Mar 29 22:58:53 CEST 2016


In our previous episode, Sven Barth said:
> > types with fields of type Word, Smallint etc, than then some Cardinal
> > fields got mixed in too. I would normally use LongWord instead of
> > Cardinal to keep to a consistent naming convention. But from your
> > comments Cardinal has a long history in Pascal.
> 
> I usually use LongWord, too, but with the recent discovery that in Delphi
> LongWord is not always 32-bit (and my tendency to confuse Short and
> SmallInt) I'm inclined to use the (U)IntX (with X being a element of [8,
> 16, 32, 64]) types to avoid any confusion and surprises.

Apparently Embarcadero knew that too, since (with iirc XE2) they added all
variants to Delphi.  FPC supports this for some releases already too (and
longer in ctypes)

I always found specially small and short very confusing so I adopted it
early.



More information about the fpc-pascal mailing list