This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: struct __attribute((packed));


E. Weddington writes:
 > Paul Koning wrote:
 > 
 > >>>>>>"E" == E Weddington <ericw@evcohs.com> writes:
 > >>>>>>            
 > >>>>>>
 > >
 > > 
 > > E> typedef int packed_int __attribute__ ((aligned (1)));
 > >
 > >I'd rather the compiler got the work than the docs.
 > >
 > >Maybe it's better in newer versions; I don't have anything newer than
 > >3.4.1 built right now.
 > >
 > >Test program:
 > >
 > >typedef int pi __attribute__((packed));
 > >
 > >  
 > >
 > No, look what I wrote above. Can you try using the *aligned* attribute?:
 > 
 > typedef int packed_int __attribute__ ((aligned (1)));

gcc.info:

     The `aligned' attribute can only increase the alignment; but you
     can decrease it by specifying `packed' as well.  See below.

Andrew.


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