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

Re: [Xen-devel] [PATCH 2/5] xen/common: Cleanup use of __attribute__((packed))



On 13/03/14 08:15, Jan Beulich wrote:
>>>> On 12.03.14 at 20:08, Andrew Cooper <andrew.cooper3@xxxxxxxxxx> wrote:
>> --- a/xen/common/trace.c
>> +++ b/xen/common/trace.c
>> @@ -641,11 +641,11 @@ static inline void insert_wrap_record(struct t_buf 
>> *buf,
>>  
>>  static inline void insert_lost_records(struct t_buf *buf)
>>  {
>> -    struct {
>> +    struct __packed {
>>          u32 lost_records;
>>          u32 did:16, vid:16;
>>          u64 first_tsc;
>> -    } __attribute__((packed)) ed;
>> +    } ed;
> So why did you not strip this one in the previous patch?
>
> Jan
>

My reading of a recent C spec draft would indicate that the compiler is
perfectly at liberty to expand these :16 bitfields up 32 bits each, if
it feels like doing so.

For peace of mind, I left all structures with bitfields with their
__packed attributes.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.