But does that work in Delphi, did you test?

You are correct - Delphi also requires that source and target are of same size - thanks!

I finally figured why existing Delphi code was not compiling - I did not use {$mode delphi} in the unit - i did not want to add {$mode dlephi} to
every file - so I used -Mdelphi in the fpc command line - it

program setcast;

type
  tenum = 0..63;
  tmyset= set of tenum;

var x:int64;
    y:tmyset;

begin
   writeln(sizeof(tmyset));
   x:=int64(y);
   y := tmyset(x);

end.

If you compile this program "fpc -Mdelphi setcast.pas" - it will not complile :(
But if you add {$mode delphi} - it will :)

And I know why - if you have {$mode delphi} - sizeof(tmyset) is 8, but if you do not (and use -Mdelphi) sizeof(tmyset) is 32 Do you know why -Mdelphi is different from {$mode delphi} w.r.t to sizeof(tmyset)?

Thanks,
Gennady


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

Reply via email to