Adriaan van Os wrote:
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'.
I will be pleased with the latter solution and it should be sufficient, especially in combination with a maximum-field-alignment directive.
OK. Will work in the next release.
Besides, some platforms require bigger alignment (many RISC machines). So, say, an Integer that happens to fall on an odd byte boundary would work as a `var' parameter on some machine and not on others.
Which implies that on such a platform --pack-struct will not pack on byte-boundaries but "more precisely, just like what GCC does" ?
I suppose so (would have to try it).
You migth say that it allows compilation of some BP (and maybe other dialect) programs which do use packed fields as `var' parameters (non-standard, since BP ignores `packed' completely). But it wouldn't work in general. A general solution to *this* problem would be a new option `ignore-packed' which is also easy to implement. Then BP compatibility would use `--pack-struct --ignore-packed'. :-)
Sounds logical.
OK. I also make `--ignore-packed' the default for `--ucsd-pascal', `--borland-pascal' and `--delphi' (perhaps also for `--mac-pascal', but someone will have to check the options for `--mac-pascal', 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).
A maximum-field-alignment option and directive will be very welcome.
OK. (It's in bits, BTW.)
Frank