From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYL1G-0001zn-Vc for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:25:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYL1F-0001xg-DB for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:25:05 -0400 Received: from [199.232.76.173] (port=48515 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYL1F-0001xJ-5Z for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:25:05 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52209) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYL1E-0007Nl-KW for qemu-devel@nongnu.org; Wed, 27 Aug 2008 09:25:04 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDOSMG020248 for ; Wed, 27 Aug 2008 09:24:48 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7RDOHep015945 for ; Wed, 27 Aug 2008 09:24:17 -0400 Received: from zweiblum.travel.kraxel.org (vpn-4-120.str.redhat.com [10.32.4.120]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m7RDOBr7016867 for ; Wed, 27 Aug 2008 09:24:11 -0400 Message-ID: <48B5557A.3000901@redhat.com> Date: Wed, 27 Aug 2008 15:24:10 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch] add byteordered types References: <48B53E23.5040107@redhat.com> <200808271320.23183.paul@codesourcery.com> <48B550F3.709@redhat.com> In-Reply-To: <48B550F3.709@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Gerd Hoffmann wrote: > Paul Brook wrote: >> On Wednesday 27 August 2008, Gerd Hoffmann wrote: >>> +typedef struct { uint16_t le; } le16; >> This won't do what you expect on some targets. In particular older ARM targets >> align all structs to a word (4-byte) boundary. > > Is this a default which can be changed by adding alignment atttributes? ... like this: -typedef struct { uint16_t le; } le16; +typedef struct { uint16_t le; } le16 __attribute__((__aligned__(2))); Is the size if the struct padded to 4 bytes too (i.e. do I need packed too)? cheers, Gerd