On 04 Oct 2006, at 10:36, Alexander Todorov wrote:
2) In the test program the addresses of the two fields are the same due to the default aligning used by the compiler. That's why the output is the number 100. In Delphi these addresses differ in 1 byte, so the ouput is : V.Flag=FALSE, V.false_1=100, V.true_1=200 V.Flag=TRUE, V.false_1=100, V.true_1=200 Is this by design or FPC has an inconsistency with Delphi?
Both. All components of the variant part of a record always start at the same address by design (because it avoids changing the overlapping of the variant fields depending on the packrecords setting), and apparently this is different in Delphi.
Jonas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal