This is the mail archive of the ecos-discuss@sourceware.cygnus.com 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]

Re: Packed on a Arm Evaulation Board


Gary Thomas wrote:
> 
> Try
> 
>   struct ABC { ...whatever... } __attribute__ ((aligned(1), packed));

I've found from experience that you can't mix the aligned and packed
attributes. Also the aligned attribute only describes the alignment of the
structure, not of the fields inside it (For Gary's benefit, read the thread
subject "eCos 1.3.5 branch" around 4th/5th May from our internal lists).

Individual members of a struct can also
have __attribute__((packed)) on them, e.g. from gcc.info:

Here is a structure in which the field `x' is packed, so that it
immediately follows `a':  

  struct foo
  { 
    char a;
    int x[2] __attribute__ ((packed));
  };

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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