Re: Strange warnings with gcc 4.1.2

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

 



"Richard W.M. Jones" <rjones@xxxxxxxxxx> wrote:
> Other warnings:
>
> virsh.c: In function ‘cmdSchedinfo’:
> virsh.c:1138: warning: ‘weight’ may be used uninitialized in this function
> virsh.c:1140: warning: ‘cap’ may be used uninitialized in this function
>
> For some reason gcc appears to have lots its ability to do the data
> flow analysis to find out that these warnings are bogus.  In any case
> the fix is trivial:

Yeah, annoying.  But I'm not sure it's even possible for
the compiler to discover that one.
But something good did come of it: when I was looking at it
yesterday.  I noticed bugs in that use of strtol.

E.g., the caller silently truncates a 64-bit long value to
the "int" return value.   Also, it doesn't detect overflow.

Will send a patch later today, unless someone else wants to do it.

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