This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Arm structure alignment


I'm porting a legacy app and need binary compatibility with the structures
written to disk.
Can I force GCC to pack *all* structures from the command line? to avoid going
through all the sources and adding __attribute__((packed)) to all the structure
definitions.

A seperate question... where exactly does the above magic string go?

I have a struct of the form...
struct mystruct {
  char bytes[6];
};
which gcc is insisting on padding to 8 bytes and is causing me unlimited
problems.

What's the effect of...

struct mystruct {
  char bytes[6] __attribute__((packed));
};

struct mystruct {
  char bytes[6];
} __attribute__((packed));

struct mystruct {
  char bytes[6] __attribute__((packed));
} __attribute__((packed));

Thanks,
Shaun


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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