Re: [PATCH v7 1/3] vdagentd: Quiet uninitialized variable warning.

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

 



Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

On Fri, Jan 27, 2017 at 06:53:38PM +0100, Michal Suchanek wrote:
> With gcc 6.2.1 I cannot build vdagentd because gcc detects msg_type as
> potentially uninitialized and vdagentd is built with -Werror.
> 
> gcc 4.8.5 does not detect the issue and gcc 7 should be able to tell
> that do_client_file_xfer is called only with values of
> message_header->type handled in the switch.
> 
> Signed-off-by: Michal Suchanek <msuchanek@xxxxxxx>
> ---
> v2:
>  - use g_return_if_reached
> v7:
>  - reword
> ---
>  src/vdagentd/vdagentd.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
> index e934f3f..5ca0106 100644
> --- a/src/vdagentd/vdagentd.c
> +++ b/src/vdagentd/vdagentd.c
> @@ -328,6 +328,8 @@ static void do_client_file_xfer(struct vdagent_virtio_port *vport,
>          id = d->id;
>          break;
>      }
> +    default:
> +        g_return_if_reached(); /* quiet uninitialized variable warning */
>      }
>  
>      conn = g_hash_table_lookup(active_xfers, GUINT_TO_POINTER(id));
> -- 
> 2.10.2
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]