From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 2/5] xen/common: Cleanup use of __attribute__((packed)) Date: Thu, 13 Mar 2014 10:22:45 +0000 Message-ID: <532186F5.40608@citrix.com> References: <1394651319-8893-1-git-send-email-andrew.cooper3@citrix.com> <1394651319-8893-3-git-send-email-andrew.cooper3@citrix.com> <53217725020000780012384F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53217725020000780012384F@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Keir Fraser , Xen-devel List-Id: xen-devel@lists.xenproject.org On 13/03/14 08:15, Jan Beulich wrote: >>>> On 12.03.14 at 20:08, Andrew Cooper 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