[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Alignement on ARM

On 12 May 2010 20:21, Vincent Bernat <bernat@debian.org> wrote:

> Luca,     thanks    for     your     answer.    Unfortunately,     using
> __attribute__((aligned(2)))   would   align   the  pointer   to   struct
> sockaddr. I have no way to force alignment of the struct itself.

Gee, I completely misread the code (and even copy-pasted it!!)
Anyway, paying more attention to it, the first member of struct sockaddr is
short int sa_family, that must be 2 byte aligned.
Since C doesn't allow the reordering of struct members, the whole
struct must be 2byte aligned.
But then I don't understand why gcc is whining...


Reply to: