[Spice-devel] [PATCH v7 1/3] vdagentd: Quiet uninitialized variable warning.
Victor Toso
victortoso at redhat.com
Tue Jan 31 08:27:55 UTC 2017
Hi,
On Mon, Jan 30, 2017 at 01:05:39PM +0100, Christophe Fergeau wrote:
>
> Acked-by: Christophe Fergeau <cfergeau at redhat.com>
and pushed!
>
> 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 at suse.de>
> > ---
> > 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 at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170131/86cfc5fa/attachment.sig>
More information about the Spice-devel
mailing list