From: Eric Blake <eblake@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH] block/vpc: fix uninitialised variable compiler warning
Date: Fri, 21 Jul 2017 07:11:39 -0500 [thread overview]
Message-ID: <ea6a3728-f96d-053d-9e90-a2404e193a8c@redhat.com> (raw)
In-Reply-To: <1500625265-23844-1-git-send-email-mark.cave-ayland@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 1170 bytes --]
On 07/21/2017 03:21 AM, Mark Cave-Ayland wrote:
> 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>
> ---
> block/vpc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
> diff --git a/block/vpc.c b/block/vpc.c
> index 10e6519..574879b 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;
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-07-21 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-21 8:21 [Qemu-devel] [PATCH] block/vpc: fix uninitialised variable compiler warning Mark Cave-Ayland
2017-07-21 12:11 ` Eric Blake [this message]
2017-07-21 12:13 ` Stefan Hajnoczi
2017-07-21 15:25 ` Peter Maydell
2017-07-27 12:53 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea6a3728-f96d-053d-9e90-a2404e193a8c@redhat.com \
--to=eblake@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).