On 11/19/2026 12:36 AM, Michael Van Canneyt via fpc-pascal wrote:


On Wed, 18 Nov 2026, Gene Buckle via fpc-pascal wrote:

I wrote a quick line to see how big a smallint is:

program main;

{$mode objfpc}
uses browserconsole;  // For output in correct console panel...

begin
  Writeln('shortint is ', SizeOf(shortint), ' bytes.');
end.

Compiling results in this error:

tmp/main.pp(8,27) Error: identifier not found "SizeOf"

Compiling the same program (sans the browserconsole unit) works as expected.

That's expected, since the pas2js compiler is emitting Javascript, and
javascript types/variables do not have a size. Consequently, pas2js does not
recognize any SizeOf/Offset etc. intrinsics.

I'm still working on having the actual FPC compiler as a backend, which
would emit WebAssembly, and then it would work.

Got it.  Thanks for the info!

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.

I'm not crazy, I'm plausibly off-nominal!

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
https://github.com/geneb/ScarletDME - Get it _today_!

_______________________________________________
fpc-pascal maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to