From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkDA0-00033p-7F for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:49:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkD9x-0006ST-1T for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:49:52 -0400 Received: from mail-ye0-f177.google.com ([209.85.213.177]:37465) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkD9w-0006SK-TW for qemu-devel@nongnu.org; Wed, 05 Jun 2013 08:49:48 -0400 Received: by mail-ye0-f177.google.com with SMTP id l8so344574yen.22 for ; Wed, 05 Jun 2013 05:49:48 -0700 (PDT) Sender: Richard Henderson Message-ID: <51AF33E8.4010704@twiddle.net> Date: Wed, 05 Jun 2013 05:49:44 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1369430452-27598-1-git-send-email-rth@twiddle.net> <1370397380.17798.73.camel@liguang.fnst.cn.fujitsu.com> In-Reply-To: <1370397380.17798.73.camel@liguang.fnst.cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] tcg-arm: Implement tcg_register_jit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: li guang Cc: qemu-devel@nongnu.org On 06/04/2013 06:56 PM, li guang wrote: >> > +typedef struct { >> > + uint32_t len __attribute__((aligned((sizeof(void *))))); >> > + uint32_t cie_offset; >> > + tcg_target_long func_start __attribute__((packed)); >> > + tcg_target_long func_len __attribute__((packed)); > suspicious usage of packed attribute here, > since tcg_targe_long is either 32 or 64 bits, > not a struct or union. > > Thanks! > Your question is worded poorly -- what has struct/union got to do with it? One can adjust the alignment of any type. Perhaps you don't know what it is that __attribute__((packed)) actually does? While it's true that for ARM all four of these data members are 32-bit, and thus none of the attributes are required, it's not actually wrong. Given that this sort of boiler-plate tends to get copied from target to target, and since the attributes *are* required for 64-bit hosts, I prefer to keep all such structures defined similarly. r~