[fpc-devel] Freepascal in microcontrollers
Daniël Mantione
daniel.mantione at freepascal.org
Wed Feb 27 22:46:35 CET 2008
Op Wed, 27 Feb 2008, schreef Jonas Maebe:
> As I said it's an opaque construct (so no control or guarantees whatsoever
> about the layout) and it was not written with hardware interfacing in mind
> (regardless of what other people like to promote it for).
Ok, I'll bite, we have something to discuss :)
Bitpacking can have two uses:
A) Saving the last bit of memory
B) Binary matching structures (which can be hardware)
Throw away (B) and half (most?) of the use of the feature is gone.
Of course the compiler should be internally consistent. A record written
on i.e. Windows should be readable on i.e. Linux. Only if {$packrecords C}
is used, we pack records according to ABI, as to interface with the OS.
There is no reason why bitpacked records should be any different from
packed records: They should internally consistent. Therefore, the packing
behaviour should be known, documented, and therefore usable for binary use.
In other words, if there will be ever differences as to target platforms,
this has to happen only under $packrecords C, or an equivalent
directive for bitpacked records.
Daniël
More information about the fpc-devel
mailing list