From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrY5w-0008LY-CH for qemu-devel@nongnu.org; Sat, 05 Jan 2013 13:03:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrY5v-00086I-42 for qemu-devel@nongnu.org; Sat, 05 Jan 2013 13:03:44 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51861 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrY5u-000802-SC for qemu-devel@nongnu.org; Sat, 05 Jan 2013 13:03:43 -0500 Message-ID: <1357408969.9901.9.camel@Thinktank.site> From: Tim Hardeck Date: Sat, 05 Jan 2013 19:02:49 +0100 In-Reply-To: References: <1357133386-7643-1-git-send-email-thardeck@suse.de> <1357133386-7643-3-git-send-email-thardeck@suse.de> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-rzD/FPRgvMZtQsfxp0TN" Mime-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 2/3] vnc: added initial websocket protocol support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: aliguori@us.ibm.com, stefanha@gmail.com, github@martintribe.org, qemu-devel@nongnu.org, alevy@redhat.com, kraxel@redhat.com, corentin.chary@gmail.com --=-rzD/FPRgvMZtQsfxp0TN Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, thanks for your suggestions. On Fri, 2013-01-04 at 20:20 +0000, Blue Swirl wrote: > On Wed, Jan 2, 2013 at 1:29 PM, Tim Hardeck wrote: > > + * We are working around a bug present in GCC < 4.6 which prevent= ed > > + * it from recognizing anonymous structs and unions. > > + * See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D4784 > > + */ > > +typedef struct __attribute__ ((__packed__)) ws_header_s { >=20 > Please use QEMU_PACKED. >=20 > > + unsigned char b0; > > + unsigned char b1; > > + union { > > + struct __attribute__ ((__packed__)) { >=20 > I think individual items inside a packed struct are automatically packed. According to http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Type-Attributes.html the packed attribute should work like you suggest but if I don't add QEMU_PACKED to the member structs too I get decoding issues. I have incorporated everything else in my new patch set but am going to wait for more feedback. Regards Tim --=20 SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer, HRB 16746 (AG N=C3=BCrnberg) Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany T: +49 (0) 911 74053-0 F: +49 (0) 911 74053-483 http://www.suse.de/ --=-rzD/FPRgvMZtQsfxp0TN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQEcBAABAgAGBQJQ6GrMAAoJENur/L6EMd67HMkIAKASE+O8PgTiYQgbjajWNEK/ xur113nvlNjgSbmvibkSsYpzZbtc8GuKcUzZejfrJeSk2Tc+NjvaRuk+N4ojYbzS NDd8OgRHXVB2CwG2E3khTi9AUmZryScIBU3FHKLU7WuZD/j7nUwVJdm4hi9RXAZD FfXRpE8kpUccTiN5QXrxtzl2goYsZ9DVyjdWuDV/0o4PyS4jsIqqmkfmQZKlKD0C x/jL+pvFnpaNMsydBqFbqcGi3pYC2upOw7wGW4xdR1mY6Y1bbnxatWjoIp9njIvz HLwL1SWwR7ut2T9J+AMDP+7I4OOKYNnZMsYNBc+BYZIbS6maj/F3uG1qahNYpXM= =mzNs -----END PGP SIGNATURE----- --=-rzD/FPRgvMZtQsfxp0TN--