qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/1] migration: fix compiler warning on uninitia


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH 1/1] migration: fix compiler warning on uninitialized variable
Date: Wed, 2 Nov 2016 07:30:27 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0

On 31/10/16 21:50, Jeff Cody wrote:

> Some older GCC versions (e.g. 4.4.7) report a warning on an
> uninitialized variable for 'request', even though all possible code
> paths that reference 'request' will be initialized.   To appease
> these versions, initialize the variable to 0.
> 
> Reported-by: Mark Cave-Ayland <address@hidden>
> Signed-off-by: Jeff Cody <address@hidden>
> ---
>  migration/colo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/migration/colo.c b/migration/colo.c
> index e7224b8..93c85c5 100644
> --- a/migration/colo.c
> +++ b/migration/colo.c
> @@ -439,7 +439,7 @@ void *colo_process_incoming_thread(void *opaque)
>      }
>  
>      while (mis->state == MIGRATION_STATUS_COLO) {
> -        int request;
> +        int request = 0;
>  
>          colo_wait_handle_message(mis->from_src_file, &request, &local_err);
>          if (local_err) {
> 

Hi Jeff,

I can confirm that this patch fixes the issue for me (and indeed I see
that Peter has already applied this to git master as a build fix).


Many thanks,

Mark.




reply via email to

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