From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThNxp-0006dt-31 for qemu-devel@nongnu.org; Sat, 08 Dec 2012 12:13:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThNxn-0007xM-OS for qemu-devel@nongnu.org; Sat, 08 Dec 2012 12:13:21 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:49354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThNxn-0007xI-Fo for qemu-devel@nongnu.org; Sat, 08 Dec 2012 12:13:19 -0500 Message-ID: <1354986797.12642.21.camel@Quad> From: Laurent Vivier Date: Sat, 08 Dec 2012 18:13:17 +0100 In-Reply-To: <50C3711F.9050508@suse.de> References: <1354979928-19000-1-git-send-email-laurent@vivier.eu> <50C3711F.9050508@suse.de> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] linux-user: correctly align types in thunking code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?Q?F=E4rber?= Cc: Peter Maydell , Riku Voipio , qemu-devel@nongnu.org Le samedi 08 d=C3=A9cembre 2012 =C3=A0 17:55 +0100, Andreas F=C3=A4rber a = =C3=A9crit : > Am 08.12.2012 16:18, schrieb Laurent Vivier: > > Signed-off-by: Laurent Vivier > > --- > > thunk.h | 22 +++++++++++++++++----- > > 1 file changed, 17 insertions(+), 5 deletions(-) > >=20 > > diff --git a/thunk.h b/thunk.h > > index 87025c3..d3e9f3d 100644 > > --- a/thunk.h > > +++ b/thunk.h > > @@ -151,20 +151,32 @@ static inline int thunk_type_align(const argtype = *type_ptr, int is_host) > > case TYPE_CHAR: > > return 1; > > case TYPE_SHORT: > > - return 2; > > + if (is_host) { > > + return __alignof__(short); >=20 > Might __alignof__() depend on a certain GCC version? Is it supported by > clang? I'm a big fan of copy&paste: I took them from linux-user/syscall.c : static const StructEntry struct_termios_def =3D { .convert =3D { host_to_target_termios, target_to_host_termios }, .size =3D { sizeof(struct target_termios), sizeof(struct host_termios) = }, .align =3D { __alignof__(struct target_termios), __alignof__(struct hos= t_termios) }, }; Regards, Laurent