[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: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers |
Date: |
Mon, 16 Nov 2015 11:47:50 +0800 |
User-agent: |
Mutt/1.5.23 (2015-06-09) |
On Fri, Nov 13, 2015 at 11:50:03AM +0100, Alberto Garcia wrote:
> 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!
I just noticed another issue that will require another revision (unless
I misread the code).
Stefan
signature.asc
Description: PGP signature