From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi2W4-00016b-OU for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yi2W0-0006Xn-Lb for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:12:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yi2W0-0006Xg-F5 for qemu-devel@nongnu.org; Tue, 14 Apr 2015 11:12:40 -0400 Message-ID: <552D2E61.9000402@redhat.com> Date: Tue, 14 Apr 2015 09:12:33 -0600 From: Eric Blake MIME-Version: 1.0 References: <1428523369-13700-1-git-send-email-peter.maydell@linaro.org> <552D1940.5030709@redhat.com> <552D2451.5040403@redhat.com> <552D25B2.4010002@redhat.com> <552D2924.5090502@redhat.com> In-Reply-To: <552D2924.5090502@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mMtQ0nSbtaFrCdAq09UVWrlWEkfJHMKQt" Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Maydell Cc: QEMU Developers , Michael Roth , Patch Tracking This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mMtQ0nSbtaFrCdAq09UVWrlWEkfJHMKQt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/14/2015 08:50 AM, Paolo Bonzini wrote: >=20 >=20 > On 14/04/2015 16:35, Eric Blake wrote: >> On 04/14/2015 08:29 AM, Paolo Bonzini wrote: >>> But you can: gsize is defined to be "An unsigned integer type of >>> the result of the sizeof operator, corresponding to the size_t >>> type defined in C99. >> >> Good so far. >> >>> This type is wide enough to hold the numeric value of a pointer, >> >> Not true on platforms where size_t is 32 bits but pointers are 64 >> bits. >=20 > Are there any? I don't think QEMU supports them anyway. Hmm. I looked, but mingw64 (32-bit long, 64-bit size_t and pointers) and x32 ABI on x86_64 (32-bit size_t, but also 32-bit pointers) are both safe, and I couldn't think of any other common platforms likely to be an oddball. Still, the point remains that the glib statement is not required to be true, and only happens to work on the common platforms it is ported to, because it IS within the bounds of the standard to restrict maximum object size to be less than the range of a pointer. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --mMtQ0nSbtaFrCdAq09UVWrlWEkfJHMKQt 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/ iQEcBAEBCAAGBQJVLS5hAAoJEKeha0olJ0NqRW4H/jI9epYnBBl5jZjh6AcLnYbW JdsMVC6Ky8I56QDsevxy/xX5tiY14X8M+haY2kpG0sS8f0QiQ09Pak4Zn8ikShKl kCcz6F+bAHpydqF8prA7qXfECtojE94rOsye8jLi1u1HwgE24GQrl5xLgiJIKBvW GfmuYYoXYF27HSTkbo4Bw+OQgDdg87xShlLB3Mlhwrs8jo4uzfE9w0U/cWng/1bh bCwj/HROQSZp+FNEyFbE7TwPLMOLlhC/L1jwoWo2SQh6KMZlDwQUaTl9rlhiWw3n bQKd0Bk5hTRtIwNafMT4x+2W8xKXRJY2Y80clfK5jspjG2Gpe7zEQeF/CtIB0i8= =0k3D -----END PGP SIGNATURE----- --mMtQ0nSbtaFrCdAq09UVWrlWEkfJHMKQt--