From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z79mH-00055Q-OJ for qemu-devel@nongnu.org; Mon, 22 Jun 2015 18:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z79mD-0003B3-N6 for qemu-devel@nongnu.org; Mon, 22 Jun 2015 18:01:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z79mD-0003AR-Hf for qemu-devel@nongnu.org; Mon, 22 Jun 2015 18:01:13 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id AB51A359A53 for ; Mon, 22 Jun 2015 22:01:12 +0000 (UTC) Message-ID: <558885A3.202@redhat.com> Date: Mon, 22 Jun 2015 16:01:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1435001200-20610-1-git-send-email-armbru@redhat.com> <1435001200-20610-4-git-send-email-armbru@redhat.com> In-Reply-To: <1435001200-20610-4-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="v5XnCMvjH3pL3P5akNeUH3NGAlql7CXOt" Subject: Re: [Qemu-devel] [PATCH 3/7] qga: Clean up unnecessarily dirty casts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, dgilbert@redhat.com, mst@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --v5XnCMvjH3pL3P5akNeUH3NGAlql7CXOt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/22/2015 01:26 PM, Markus Armbruster wrote: > qga_vss_fsfreeze() casts error_set_win32() from >=20 > void (*)(Error **, int, ErrorClass, const char *, ...) >=20 > to >=20 > void (*)(void **, int, int, const char *, ...) >=20 > The result is later called. Since the two types are not compatible, > the call is undefined behavior. It works in practice anyway. Better than some other horrid casts we do, like monitor.c playing fast and loose with 'Monitor *' vs. 'FILE *' in hmp_info_mtree() and friends. But that's a cleanup for another series. >=20 > However, there's no real need for trickery here. Clean it up as > follows: >=20 > * Declare struct Error, and fix the first parameter. >=20 > * Switch to error_setg_win32(). This gets rid of the troublesome > ErrorClass parameter. Requires converting error_setg_win32() from > macro to function, but that's trivially easy, because this is the > only user of error_set_win32(). >=20 > Signed-off-by: Markus Armbruster > --- Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --v5XnCMvjH3pL3P5akNeUH3NGAlql7CXOt 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/ iQEcBAEBCAAGBQJViIWjAAoJEKeha0olJ0NqrdUH/jZoDpeTWy704SqjSU70gsEo 6OVmJeoox5r8ggdH+N0ROZo/pWYNroWn6BSPXxX+OLUABwcvAgY4qyDpqvmcRUHv yZkGCC/NF1IJBnlcIZZSqx9guYMhnM52tw8lbpNLb5psFnV+OobLXm0D+eIdb8E/ z7fW9DRssVCoWpE07kwH/vSvPqC4UUoVvibXVf1qZn5XOaTzV6474x/3Xnkahnbh X9YKNXay0IM5sqjGZSSbwK3bdjLhwZ6VUWPcg1rMDtgnygeKa8J9V1IFR2/9sWQd V92hikctBh9u1aXcsoVNsYO5kr1z4cicJv4Of6o1cIFIyKt6i+hwKmWXXKicKgg= =HAFp -----END PGP SIGNATURE----- --v5XnCMvjH3pL3P5akNeUH3NGAlql7CXOt--