[fpc-devel] Just need to double check the size of Integer

Ondrej Pokorny lazarus at kluug.net
Thu Nov 24 14:32:19 CET 2022


Am 24.11.2022 um 14:15 schrieb Marco van de Voort via fpc-devel:
>
> On 24-11-2022 14:13, J. Gareth Moreton via fpc-devel wrote:
>>
>> I just need to double-check something.  Under CPU16, SizeInt and 
>> SizeUInt are declared as follows:
>>
>>   SizeInt = Integer;
>>   SizeUInt = Word;
>>
>> Is Integer 16-bit in this case? 
>
> Yes.
>
>> I always thought Integer was defined as a signed 32-bit integer under 
>> FreePascal. 
>
> No. Only in objfpc/delphi modes, and system is in $mode FPC. Unit 
> objpas overrides this definition and is loaded in objfpc/delphi mode.

OK, I found it. Actually within the system unit Integer is always 16-bit 
because it is re-declared on line 114:
Integer  = SmallInt;

So yes, Integer in the system unit is 16-bit but because of the 
re-declaration and not the mode.

Ondrej



More information about the fpc-devel mailing list