[ECOS] pragma pack
Paul D. DeRocco
pderocco@ix.netcom.com
Wed Jan 9 22:22:00 GMT 2008
> From: Bronislav Gabrhelik
>
> Beware of bad alignment of timestamp field. Some processors
> might raise an exception/interrupt when you use the int like
> operation directly on field (including assignment &
> evaluation). You should copy out/in this by memcpy into/from
> temporary variable of the same type when you need to do some
> integer computing on this field. In other case your code
> might not be portable.
I think that's the point of the __packed__ attribute: it forces the compiler
for any machine on which it matters to do the necessary byte
packing/unpacking automagically. I know that's what the Gnu ARM compiler
does.
--
Ciao, Paul D. DeRocco
Paul mailto:pderocco@ix.netcom.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list