All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Patch Tracking <patches@linaro.org>
Subject: Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode()
Date: Tue, 14 Apr 2015 09:12:33 -0600	[thread overview]
Message-ID: <552D2E61.9000402@redhat.com> (raw)
In-Reply-To: <552D2924.5090502@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

On 04/14/2015 08:50 AM, Paolo Bonzini wrote:
> 
> 
> 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.
> 
> 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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2015-04-14 15:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 20:02 [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() Peter Maydell
2015-04-08 20:14 ` Michael Roth
2015-04-14 13:38 ` Thomas Huth
2015-04-14 13:41   ` Peter Maydell
2015-04-14 14:30     ` Paolo Bonzini
2015-04-14 13:42 ` Paolo Bonzini
2015-04-14 13:45   ` Peter Maydell
2015-04-14 14:29     ` Paolo Bonzini
2015-04-14 14:35       ` Eric Blake
2015-04-14 14:50         ` Paolo Bonzini
2015-04-14 15:12           ` Eric Blake [this message]
2015-04-14 14:36       ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552D2E61.9000402@redhat.com \
    --to=eblake@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=patches@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.