From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSt1x-00084r-9E for qemu-devel@nongnu.org; Thu, 28 Jul 2016 17:39:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSt1t-0006LL-VG for qemu-devel@nongnu.org; Thu, 28 Jul 2016 17:39:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSt1t-0006LA-MP for qemu-devel@nongnu.org; Thu, 28 Jul 2016 17:39:45 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 48F5F8122D for ; Thu, 28 Jul 2016 21:39:45 +0000 (UTC) References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-4-marcandre.lureau@redhat.com> <579A76C0.8080104@redhat.com> <503530863.9448361.1469741819715.JavaMail.zimbra@redhat.com> From: Eric Blake Message-ID: <579A7BA0.8060303@redhat.com> Date: Thu, 28 Jul 2016 15:39:44 -0600 MIME-Version: 1.0 In-Reply-To: <503530863.9448361.1469741819715.JavaMail.zimbra@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SlWrhvdPXqqb2aahtljRjGOS2nhXdQbB5" Subject: Re: [Qemu-devel] [PATCH v2 03/37] qga: free the whole blacklist List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: marcandre lureau , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SlWrhvdPXqqb2aahtljRjGOS2nhXdQbB5 From: Eric Blake To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: marcandre lureau , qemu-devel@nongnu.org Message-ID: <579A7BA0.8060303@redhat.com> Subject: Re: [PATCH v2 03/37] qga: free the whole blacklist References: <20160728143808.13707-1-marcandre.lureau@redhat.com> <20160728143808.13707-4-marcandre.lureau@redhat.com> <579A76C0.8080104@redhat.com> <503530863.9448361.1469741819715.JavaMail.zimbra@redhat.com> In-Reply-To: <503530863.9448361.1469741819715.JavaMail.zimbra@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/28/2016 03:36 PM, Marc-Andr=C3=A9 Lureau wrote: >>> + g_list_foreach(config->blacklist, (GFunc)g_free, NULL); >> >> What an ugly cast - undefined behavior according to C. But it happens = to >> work on all ABI that we support (calling a unary function as cast to >> appear as a binary function silently ignores the second argument), so = I >> could sort of live with it, if it made the patch arguably smaller due = to >> fewer lines of code than required for a type-correct solution. >=20 >=20 > Note that's how glib implements g_slist_free_full() and others, I just = used the same common code/style Just because glib disregards C type safety and relies on platform ABI doesn't mean we have to be equally cavalier in our code. Again, I'm not outright rejecting your shorter style, precisely because glib already uses the style (so it already happens to work), but do think that it is easier to maintain code that doesn't have ugly casts (where I have to think about ABI issues) because it is C-compliant to begin with. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SlWrhvdPXqqb2aahtljRjGOS2nhXdQbB5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXmnugAAoJEKeha0olJ0NqTT0H/jJW2x4fAwNup+3IfZ+33RN5 aJgRERj3mmojo/JRl4EH++9drQVJt2A+4o8Eo6o5M8mr92BLB2EAiVVO4gjgOmHJ RwEIEa6Pj4JQYxYYZcxd9fTpc/b6Pj8P7yzkN3TBKh6aNJXjfvEx1Za73SljoqE8 GItG8KQP8G7YAD0ToawKsB3gA+Mb7vswRGSYwX6f++QkNQ4vuS96TDQXlwp4jafh L+ThyVu1z+xvqtF4OvyGHqtnqIew2yEaIlMyqnkToUWmkmsrJBJG6eWdp+aHS/OB Oyejk6bi1N9oRxLY2F8vIMOxT/jQ6Qmf/sNBstgr0QJ3MMYbSfHqjr/oWb+4b2g= =IVK9 -----END PGP SIGNATURE----- --SlWrhvdPXqqb2aahtljRjGOS2nhXdQbB5--