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.




begin
writeln(sizeof(integer));
end.

without any $mode (so $mode fpc) will write 2, even on 64-bit systems.



_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to