summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorMark Cave-Ayland2017-07-21 10:21:05 +0200
committerPeter Maydell2017-07-21 16:00:07 +0200
commitc8115f8eb8b6c4742e5e0c0c644904cd81ed65fa (patch)
tree93549e05684d318f3b08335f4bff7f566a55ffab /block
parentMerge remote-tracking branch 'remotes/yongbok/tags/mips-20170721' into staging (diff)
downloadqemu-c8115f8eb8b6c4742e5e0c0c644904cd81ed65fa.tar.gz
qemu-c8115f8eb8b6c4742e5e0c0c644904cd81ed65fa.tar.xz
qemu-c8115f8eb8b6c4742e5e0c0c644904cd81ed65fa.zip
block/vpc: fix uninitialised variable compiler warning
Since commit cfc87e00 "block/vpc.c: Handle write failures in get_image_offset()" older versions of gcc (in this case 4.7) incorrectly warn that "ret" can be used uninitialised in vpc_co_pwritev(). Setting ret to 0 at the start of vpc_co_pwritev() prevents the warning in gcc 4.7 and enables compilation with -Werror to succeed. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1500625265-23844-1-git-send-email-mark.cave-ayland@ilande.co.uk Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block')
-rw-r--r--block/vpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/vpc.c b/block/vpc.c
index 10e6519d78..574879ba7c 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -649,7 +649,7 @@ vpc_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes,
int64_t image_offset;
int64_t n_bytes;
int64_t bytes_done = 0;
- int ret;
+ int ret = 0;
VHDFooter *footer = (VHDFooter *) s->footer_buf;
QEMUIOVector local_qiov;