[libvirt] [PATCH] util: Fix build with clang

Daniel P. Berrange berrange at redhat.com
Fri Dec 9 11:18:32 UTC 2016


On Fri, Dec 09, 2016 at 11:52:43AM +0100, Martin Kletzander wrote:
> When compiling with clang on Linux, it complains that "passing an
> object that undergoes default argument promotion to 'va_start' has
> undefined behavior".  That is true according to the C standard,
> although I couldn't find any mention about enum->int promotion (even
> though it's a sensible one).  The only fix I came up with was changing
> the layer parameter to int so that it does not undergo any default
> argument promotion.

Can we not just cast 'layer' to an int in the va_start call ?


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|




More information about the libvir-list mailing list