[fpc-pascal] more Variant thoughts (was: Variant record types in Sockates unit)
Jonas Maebe
jonas.maebe at elis.ugent.be
Wed Oct 4 10:54:05 CEST 2006
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
More information about the fpc-pascal
mailing list