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~