This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: pragma pack


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]