[ECOS] Re: pragma pack
Thu Jan 10 09:43:00 GMT 2008
Actually i had some problems accessing my packed structures without
flows, I think that may help resolve things a bit.
Eg with things like that:
cyg_uint8 i = 0;
struct s_pelco_pattern_array a;
a.command2_byte = i++;
a.data3 = i++;
a.data4 = i++;
a.timestamp = i;
I finish having a structure which looks like this in memory:
Which is really not what i want to have eventually.
On Jan 10, 2008 1:50 AM, Paul D. DeRocco <firstname.lastname@example.org> wrote:
> > 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:email@example.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
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