[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] qga/commands-posix.c: Use correct types with g_base64_decode() |
Date: |
Tue, 14 Apr 2015 08:35:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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.
Bug in glib documentation.
>
> If anything, I would add a QEMU_BUILD_BUG_ON(sizeof(gsize) !=
> sizeof(size_t)) to catch the problem, since we've had many experienced
> developers caught unprepared.
That would be my preference as well.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature