This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
RE: Re: pragma pack
- From: "Paul D. DeRocco" <pderocco at ix dot netcom dot com>
- To: <ecos-discuss at ecos dot sourceware dot org>
- Date: Wed, 9 Jan 2008 16:50:07 -0800
- Subject: RE: [ECOS] 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