From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWmY4-0006ex-6H for qemu-devel@nongnu.org; Mon, 29 Apr 2013 07:47:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWmXz-0005z8-Tt for qemu-devel@nongnu.org; Mon, 29 Apr 2013 07:47:12 -0400 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:35794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWmXz-0005yy-HL for qemu-devel@nongnu.org; Mon, 29 Apr 2013 07:47:07 -0400 Date: Mon, 29 Apr 2013 21:09:54 +1000 From: David Gibson Message-ID: <20130429110954.GN20202@truffula.fritz.box> References: <517BC1F2.70405@redhat.com> <1367201460-28594-1-git-send-email-aik@ozlabs.ru> <517E2C5C.8000700@redhat.com> <517E2D74.3070804@ozlabs.ru> <517E3C7C.3080604@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s3R87C3fwYeCSZ0b" Content-Disposition: inline In-Reply-To: <517E3C7C.3080604@redhat.com> Subject: Re: [Qemu-devel] [PATCH] memory: give name every AddressSpace List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Alexey Kardashevskiy , qemu-trivial@nongnu.org, qemu-devel@nongnu.org --s3R87C3fwYeCSZ0b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 29, 2013 at 11:25:16AM +0200, Paolo Bonzini wrote: > Il 29/04/2013 10:21, Alexey Kardashevskiy ha scritto: > >>> >> + g_free((void *)as->name); > >> >=20 > >> > No cast here. > > ? > >=20 > > CC ppc64-softmmu/memory.o > > /home/alexey/pcipassthru/qemu-impreza/memory.c: In function > > 'address_space_destroy': > > /home/alexey/pcipassthru/qemu-impreza/memory.c:1626:5: warning: passing > > argument 1 of 'g_free' discards 'const' qualifier from pointer target t= ype > > [enabled by default] > > g_free(/*(void *)*/as->name); > > ^ >=20 > Please remove the const from as->name instead. Since you are strdup-ing > it, and the field is meant to be private to memory.c anyway, you do not > need protection against changing it. As a general rule, pointer variables that you malloc()ate should not be const. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --s3R87C3fwYeCSZ0b Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlF+VQIACgkQaILKxv3ab8Y0GQCfX0q3ZoQiP5CoDTw5UhkNmGDn zjcAn3YUDCckTeYJ1lCQle2iDWaULmjh =eADQ -----END PGP SIGNATURE----- --s3R87C3fwYeCSZ0b--