qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fi


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 1/4] libvhost-user: replace vasprintf() to fix build
Date: Thu, 2 Mar 2017 13:28:29 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 03/02/2017 12:25 PM, Felipe Franciosi wrote:
> On gcc 3.4 and newer, simply using (void) in front of WUR functions is
> not sufficient to ignore the return value. That prevents a build when
> handling warnings as errors.
> 
> libvhost-user had a usage of (void)vasprintf() which triggered such a
> condition. This fixes it by replacing this call with g_strdup_vprintf()
> which aborts on OOM.
> 
> Signed-off-by: Felipe Franciosi <address@hidden>
> ---
>  contrib/libvhost-user/libvhost-user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <address@hidden>

> 
> diff --git a/contrib/libvhost-user/libvhost-user.c 
> b/contrib/libvhost-user/libvhost-user.c
> index af4faad..61e1657 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -81,7 +81,7 @@ vu_panic(VuDev *dev, const char *msg, ...)
>      va_list ap;
>  
>      va_start(ap, msg);
> -    (void)vasprintf(&buf, msg, ap);
> +    buf = g_strdup_vprintf(msg, ap);
>      va_end(ap);
>  
>      dev->broken = true;
> 

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

[Prev in Thread] Current Thread [Next in Thread]