J. David Bryan wrote:
The word "should" above indicates, I believe, that GPC may either reduce the storage size or not reduce the storage size, i.e., PACKED may do something, or it may not; it's up to the compiler. Of course, it would be helpful if GPC did reduce the size, either to the minimum number of bits required, or to some multiple of the minimum addressable storage element (e.g., a byte for most machines).
Yes, according to the standard, it's not required (so even Borland is conforming in this respect ;-), but since we've decided to do packing at all, we should also do it "reasonable"...
...(and the real bug seems to be that GPC doesn't carry over the `packed' to the array component).
a3:packed array[1..maxnum] of packed 0..255;
I'm not sure whether you intend for "packed" to be carried over to _all_ array components, but note that the same section of the EP standard says:
"The designation of the structured-type as packed shall affect the representation in data-storage of that structured type only; i.e., if a component is itself structured, the component's representation in data-storage shall be packed only if the type of the component itself is designated packed."
This appears to state that:
a : packed array [1..5] of array [1..5] of 0..255;
...is _not_ equivalent to:
a : packed array [1..5] of packed array [1..5] of 0..255;
I'll note that (daj14b.pas).
Frank