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: Re: pragma pack


> From: Grant Edwards
> 
> The trap snaps shut when you take the address of a field in a 
> packed struct and pass that to somebody who's expecting a 
> pointer to a normally aligned value.

True. I could imagine ways in which the type system could be designed to
prevent that, using a pointer modifier like "int __packed*", but it's not.

Anyway, for normal accesses, it works fine, so you can do things like
operate on the fields in a DOS boot sector without problems. That's the only
situation I've ever needed the feature.

-- 

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]