Received: from eggs.gnu.org ([208.118.235.92]:55932) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDKg8-0001yj-Ee for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:38:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TDKg7-0003Sq-IB for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:38:52 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:44093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TDKg7-0003Sk-CR for qemu-devel@nongnu.org; Sun, 16 Sep 2012 15:38:51 -0400 From: Mike Frysinger Date: Sun, 16 Sep 2012 15:38:55 -0400 References: <1347753913-5305-1-git-send-email-vapier@gentoo.org> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4739603.yuzLyXJ5EH"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201209161538.56333.vapier@gentoo.org> Subject: Re: [Qemu-devel] [PATCH] fix warnings from printf target addresses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org --nextPart4739603.yuzLyXJ5EH Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Sunday 16 September 2012 03:24:22 Blue Swirl wrote: > On Sun, Sep 16, 2012 at 12:05 AM, Mike Frysinger wrote: > > Current code triggers: > > memory.c: In function 'invalid_read': > > memory.c:1001: warning: format '%#x' expects type 'unsigned int', > > but argument 4 has type 'target_phys_addr_t' > > memory.c: In function 'invalid_write': > > memory.c:1013: warning: format '%#x' expects type 'unsigned int', > > but argument 4 has type 'target_phys_addr_t' > >=20 > > - fprintf(stderr, "Invalid read from memory region %s at offset > > %#x\n", mr->name, addr); + fprintf(stderr, "Invalid read from > > memory region %s at offset %#llx\n", + mr->name, > > (unsigned long long)addr); >=20 > The right way is not adding potentially dangerous casts they're not dangerous here at all > but using TARGET_PRIxPHYS or TARGET_FMT_plx. np. i just copied what was already in memory.c, but i guess that's broken= =20 too. =2Dmike --nextPart4739603.yuzLyXJ5EH Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iQIcBAABAgAGBQJQVirQAAoJEEFjO5/oN/WBRwwQAK19cJggr2IQYLWJSL0HORKR ol1txCZQ+iN0+ZH2U/WzPFMt2YKU+L5sDvez2gFKO7sGPDFJNiWGc1hN28nF2bfY fXIvNd7begaalMa57bVZiXWXj0tcKhoYpnyG3h7cFHYg4VDolGP9uk6sMEWggBp6 hZFpw3hT8W7RUXG+Z/zKCI6cublZbgmtAK2fuGuXPPd+60m07lQ1b74ku21Eku43 Nvy3f2RljKQOPVaudKIqsNgEWVBrPHoPaFvxo++cyOJedJA3To6oKpU0bPmEeAJ9 SMj1X6DX6WHh+iuj+h005oOiFo3XuA1b3s9vMWAZgrTINZ4PLUeBJvaoyVq+bZN+ eAatflyChvabPrlvHpTNqhdeF+ST4t36I0MX27R9sDU5Em6WJUGKnnDl2OZHlFqL MV4zypCDi0x5hTfHbKQjuLfGfM5ceTB50ECvgK13cuBZgcFTSG9Ep5R8r4NUYtLB AqMl9wwjUKGIzwYnx0egETLIiSMm+rPKlfk26DYhZkTEs9wMe+A0WE9/q0eO9HBx IqgOCGgB+s+vOmy94Oyu3iHzKf+w4CeTrJrdreoO9Z0SZHeGxRY/gH/T7lusNRJP 9EpFDnmdlR5gYKb86NTVFavOH0Jy9lZOlcYQZ0jT109I2rbdFeNWrc2e+slGuNTg 3rGkBEKxTE1hd24BZpfn =lqp1 -----END PGP SIGNATURE----- --nextPart4739603.yuzLyXJ5EH--