At 18:54 +0100 10/3/03, Frank Heckenbach wrote:
Basically, we need something like --record-alignment={1,2,4} (and a corresponding compiler directive we can add to the system interfaces) so that items N bytes or larger are aligned to N bytes (where N is 1 2 or 4).
Or would it be sufficient, say, to let `--pack-struct' pack to byte boundaries (more precisely, just like what GCC does), and only real `packed' structures to the bit level?
And add a compiler directive for `pack-struct'.
Yes, I believe that would be perfectly sufficient. Any weird cases where there is:
record a: UInt8; b: UInt16;
can easily be fixed with a pad byte added in (and indeed probably long since have been in the interfaces anyway!).
We don't need the `#pragma' syntax, I think. Implementing an option to set maximum_field_alignment would be easy. `maximum-field-alignment=N' (i.e. `--maximum-field-alignment=N' as a command-line option and `{$maximum-field-alignment N}' as a compiler directive; as usual these would be equivalent).
This would be a bonus as well. The above would probably solve our problem sufficiently, the latter would allow is to translate pragma align mac68k and pragma align macpower directly to alignment=2 and alignment=4.
Thanks sounds great, thanks Frank! Peter.