Re: [PATCH 1/2] virsh: Refactor parseRateStr to avoid false-positive uninitialized variable

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

 



On Wed, Aug 12, 2015 at 10:21:39 +0200, Michal Privoznik wrote:
> On 12.08.2015 07:45, Peter Krempa wrote:
> > Commit 6983d6d2 tried to improve parseRateStr but broke the build
> > instead for compilers that were not able to properly introspect the for
> > loop indexed by the enum resulting into the following error:
> > 
> > virsh-domain.c: In function 'parseRateStr':
> > virsh-domain.c:916:13: error: 'field_name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >              vshError(ctl, _("malformed %s field"), field_name);
> >              ^
> > virsh-domain.c:915:13: error: 'tmp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >          if (virStrToLong_ullp(token, NULL, 10, tmp) < 0) {
> >              ^
> > Rather than trying to fix the code, refactor the function again by
> > reusing virStringSplit.
> > ---
> >  tools/virsh-domain.c | 88 +++++++++++++++++++++-------------------------------
> >  1 file changed, 35 insertions(+), 53 deletions(-)
> > 
> 
> ACK

I've pushed this one. Thanks
> 
> Michal
> 

Attachment: signature.asc
Description: 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]