Re: [PATCH] MacOS: Handle changes to xdrproc_t definition

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

 



On 10/30/2013 10:28 AM, Doug Goldstein wrote:
> With Mac OS X 10.9, xdrproc_t is no longer defined as:
> 
> typedef bool_t (*xdrproc_t)(XDR *, ...);
> 
> but instead as:
> 
> typdef bool_t (*xdrproc_t)(XDR *, void *, unsigned int);
> 
> For reference, Linux systems typically define it as:
> 
> typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
> 
> The rationale explained in the header is that using a vararg is
> incorrect and has a potential to change the ABI slightly do to compiler
> optimizations taken and the undefined behavior. They decided
> to specify the exact number of parameters and for compatibility with old
> code decided to make the signature require 3 arguments. The third
> argument is ignored for cases that its not used and its recommended to
> supply a 0.
> ---
>  src/rpc/virnetmessage.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

ACK; passed my testing on Linux and Cygwin, and seems to be reasonable
to avoid undefined C behavior where varargs ABI on some platforms could
indeed give undesired results.  Worth having in 1.1.4.

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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]