[fpc-pascal]bug in 1.0.10? sizeof(cmyclass) returns instance size

Anton Tichawa anton.tichawa at chello.at
Sun Dec 14 00:15:39 CET 2003


Hello, List!

Using ppc386 version 1.0.10, sizeof(cmyclass) returns the size of the 
instance, e. g. 260 when there is one 'string' member, whereas ppc386 version 
1.0.6 returns the expected size of a pointer, 4. Is this a bug, or a 
deliberate change?

$: cat top/testsize.pas
program testsize;

type
  my_class = class
    fname: string;
  end;

begin
  writeln(sizeof(tobject));
  writeln(sizeof(my_class));
end.

Son Dez 14 00:12:49 /io
$: /usr/bin/ppc386 top/testsize.pas
Free Pascal Compiler version 1.0.10 [2003/06/26] for i386
Copyright (c) 1993-2003 by Florian Klaempfl
Target OS: Linux for i386
Compiling top/testsize.pas
Assembling testsize
Linking /io/obj/testsize
12 Lines compiled, 0.0 sec
Son Dez 14 00:13:00 /io
$: obj/testsize
4
260

Thank You!

Anton.





More information about the fpc-pascal mailing list