Xiangrong Fang wrote:
It seems that $packrecord does not work at all.

It works fine.

I did some research and
found this document:

http://www.freepascal.org/docs-html/ref/refsu19.html

The documentation seems to be outdated regarding the alignment of arrays. Arrays probably used to be aligned based on the size of the entire array at one point (it's before recorded history, i.e. before September 2000), or maybe the record field insertion code used to contain some special (broken) logic for arrays that ignored their alignment and instead used their size.

In any case, the alignment requirement of an array is and has been for quite some time the alignment requirement of its individual elements, and the alignment of a field's type is what's used to determine its offset in a record (with a maximum of the current packrecords setting).


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to