[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] structure packing
From: |
eric |
Subject: |
Re: [avr-gcc-list] structure packing |
Date: |
Wed, 4 Jun 2003 22:02:26 GMT |
> I find it MUCH better to manage it on a structure by
structure basis.
>
> typedef struct myDataStruct_s
> {
> char c;
> int i;
> long l;
> float f;
> }
> __attribute__ ((packed)) myDataStruct_t;
>
> myDataStruct_t someData;
>
> --John
Sure, that's also discussed in the GCC docs. This is
available for anyone to use if they desire.
Eric
>
> On Wednesday 04 June 2003 16:36 pm, address@hidden
wrote:
> > > hi,
> > > i have a limited size in memory and i dont want
compiler
> >
> > to align my
> >
> > > structure to 8 byte boundaries.I wonder if it is
possible
> >
> > with gcc. I
> >
> > > remember using pragma commands in visual C++ to avoid
> >
> > packing. What
> >
> > > would be the command for disallowing compiler to pack
the
> >
> > structure.
> >
> > > thanks.
> >
> > See the GCC docs:
> > <http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Code-Gen-
> > Options.html#Code%20Gen%20Options>
> >
> > Look for -fpack-struct. This option is used in the
WinAVR
> > sample makefile. To not pack structures, remove this
> > option, or alternatively use -fno-pack-struct.
> >
> > Don't forget to consult the manual first.
> >
> > Eric
> >
> >
> >
> > _______________________________________________
> > avr-gcc-list mailing list
> > address@hidden
> > http://www.avr1.org/mailman/listinfo/avr-gcc-list
>
>