[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [libnbd PATCH] generator: Let nbd_aio_get_direction return unsigned

On 7/25/19 4:11 PM, Eric Blake wrote:
> The return value is a bitmask, and is already documented as never
> failing, hence it makes sense to return an unsigned value to make it
> easier to do bitwise operations without worrying about potential
> undefined C semantics on a signed value.
> ---
> I'm not sure if we want this, or even if we do if my OCaml was the
> most concise, but it matches the sentiment of our recent effort to let
> the valid_flag and status parameters to callbacks be unsigned.

By the way, this changes API but not ABI; and in a way that most users
won't notice (thanks to C's looseness on implicit type conversions, an
ABI-compatible change in return type tends to not cause compile errors
unless you were using function pointers that force a bit more type safety).

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]