uisp-dev
[Top][All Lists]
Advanced

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

Re: [Uisp-dev] [patch] Alignment on ARM


From: Wojtek Kaniewski
Subject: Re: [Uisp-dev] [patch] Alignment on ARM
Date: Wed, 20 Apr 2005 17:53:06 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.7.3) Gecko/20040913 Thunderbird/0.8 Mnenhy/0.6.0.104

Raphael Assenat napisaƂ(a):
The supplemental bytes are due to the sizeof(struct SPrgParams) being equal to 24 on arm due to alignment/padding of the struct by the compiler. On an x86, it is 22 bytes.

I tried using #pragma pack(1), -fpack-structs, but the size of the struct stayed at 24. Finally, I decided to copy manually all the members of the structure into the buffer and I hardcoded the length to 22 (see diff below). That worked.

struct SPrgParams {
  // ...
} __attribute__ ((packed));

should do the thing.

regards,
wojtek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]