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.
Michael.
_______________________________________________
fpc-pascal maillist - [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal