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

Re: [Xen-devel] [PATCH] libxl: 'valid_devs' may be used uninitialized



On Fri, 2015-05-15 at 11:06 -0600, Charles Arnold wrote:
> Using gcc 4.8 to compile with -Werror.
> 
> xl_cmdimpl.c:5493:8: error: 'valid_devs' may be used uninitialized in this 
> function [-Werror=maybe-uninitialized]
>       if (valid_devs == 0)
>          ^
> xl_cmdimpl.c:5455:9: note: 'valid_devs' was declared here
>       int valid_devs;
> 
> Signed-off-by: Charles Arnold <carnold@xxxxxxxx>
> 
Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Although, while there...

> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 373aa37..6d60ce4 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -5423,7 +5423,7 @@ static void output_topologyinfo(void)
>      libxl_cputopology *cpuinfo;
>      int i, nr;
>      libxl_pcitopology *pciinfo;
> -    int valid_devs;
> +    int valid_devs = 0;
>  
>
>      cpuinfo = libxl_get_cpu_topology(ctx, &nr);
> 
...You could kill one of the two blank line (one is enough).

Regards,
Dario

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.