qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a li


From: Alberto Garcia
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers
Date: Fri, 13 Nov 2015 11:50:03 +0100
User-agent: Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu)

On Fri 13 Nov 2015 11:15:52 AM CET, Stefan Hajnoczi <address@hidden> wrote:
> blockdev.c: In function ‘blockdev_init’:
> blockdev.c:636:17: error: ‘length’ may be used uninitialized in this function 
> [-Werror=maybe-uninitialized]
>                  block_acct_add_interval(blk_get_stats(blk), length);
>                  ^
> blockdev.c:597:22: note: ‘length’ was declared here
>              unsigned length;
>                       ^

That's a false warning because length can only be uninitialized if
'error' is set.

gcc 5.2.1 does not complain here... anyway, this should fix it:

         for (entry = qlist_first(interval_list); entry;
              entry = qlist_next(entry)) {
-            unsigned length;
+            unsigned length = 0;
             switch (qobject_type(entry->value)) {

Do you want me to send a new patch, or do you prefer to apply this
change in your branch? Thanks!

Berto



reply via email to

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