[fpc-devel] New language idea: Unified types(assignmentsize-compatible types).

Sven Barth pascaldragon at googlemail.com
Sun Jun 26 11:33:55 CEST 2011

On 26.06.2011 09:49, Graeme Geldenhuys wrote:
> On 21 June 2011 13:09, Hans-Peter Diettrich<DrDiettrich1 at aol.com>  wrote:
>> A LongWord will always have 32 bits, because it's a concrete type. Instead
>> Integer, Cardinal, Char, String or Real can vary with every compiler version
>> or target platform, because these are *generic* types.
> Um, I think you are mistaken. Integer is *always* 32-bits on either
> 32-bit or 64-bit target platforms. NativeInt is different sizes on
> different target platforms. I think LongWord also varies in size based
> on target platform, though not 100% sure on this one.

No, LongWord does not vary. It's always 32-Bit.
But Hans-Peter is right so far that Integer was originally considered a 
generic type. You can still see this if you do a "SizeOf(Integer)" once 
in mode FPC (2 bytes) and in mode ObjFPC (4 bytes). I didn't test 
"SizeOf(Cardinal)" in mode FPC yet though...


More information about the fpc-devel mailing list