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

Tomas Hajny XHajT03 at hajny.biz
Thu Nov 24 14:44:36 CET 2022


On 2022-11-24 14:25, Ondrej Pokorny via fpc-devel wrote:
> 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.
> 
> Are you sure? systemh.inc is compiled with {$mode objfpc} (see line
> 22), so Integer within the system unit is 32-bit.
> 
> So to me it looks like a bug.

No, it isn't a bug - systemh.inc is indeed compiled in $MODE OBJFPC 
nowadays, but it defines Integer = SmallInt on line 110. Depending on 
compilation mode used for your sources (containing references to 
Integer), the definition in unit objpas (included automatically for 
modes objfpc and delphi) may override the definition in systemh.inc.

Tomas


More information about the fpc-devel mailing list