Re: [PATCH v3 6/9] tests: Fix mode_t usage with va_arg()

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

 



On Thu, May 03, 2018 at 12:54:20PM +0200, Andrea Bolognani wrote:
> Clang complains about it:
> 
>   error: second argument to 'va_arg' is of promotable type
>   'mode_t' (aka 'unsigned short'); this va_arg has undefined
>   behavior because arguments will be promoted to 'int'
>   [-Werror,-Wvarargs]
> 
>     mode = va_arg(ap, mode_t);
>                       ^~~~~~
> 
> Work around the issue by passing int to va_arg() and casting
> its return value to mode_t afterwards.
> 
> Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
> ---
>  tests/nssmock.c       | 2 +-
>  tests/vircgroupmock.c | 2 +-
>  tests/virpcimock.c    | 2 +-
>  tests/virtestmock.c   | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
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]

  Powered by Linux