On 29 Jul 2009, at 19:46, Florian Klaempfl wrote:
Jonas Maebe schrieb:
This is not usable for accessing particular bits of microcontroller
registers, because the internal format of a bitpacked record is
undefined and can change at any time for any reason.
Indeed, but do you think we should create a new syntax to map C
bitpacked structures?
That is possible, but hard:
a) the alignment of bitpacked C records is defined in the ABI, and
there are quite a few differences between different ABIs
b) in C, you can have "char a:1;" and "int a:1;" and these will be
aligned differently (although both are 1 bit). You'd have to invent
some Pascal syntax to match that.
Anyways, I'am using bitpacked arrays and records
already in my embedded stuff
Just don't come complaining when it breaks :)
Jonas
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel