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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to