[Spice-devel] [PATCH spice-server] red-record-qxl: fix clang warning

Christophe Fergeau cfergeau at redhat.com
Mon Mar 12 12:58:05 UTC 2018


Ok,
Acked-by: Christophe Fergeau <cfergeau at redhat.com>

On Mon, Mar 12, 2018 at 12:33:47PM +0000, Frediano Ziglio wrote:
> Fix clang warning:
> 
> red-record-qxl.c:893:13: error: variable 'fd_in' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
>         if (ret)
> 
> This is technically impossible but is not on a hot path.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-record-qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/server/red-record-qxl.c b/server/red-record-qxl.c
> index 48b3169f..5f6b7aeb 100644
> --- a/server/red-record-qxl.c
> +++ b/server/red-record-qxl.c
> @@ -886,7 +886,7 @@ RedRecord *red_record_new(const char *filename)
>          GError *error = NULL;
>          GPid child_pid;
>          gboolean ret;
> -        gint fd_in;
> +        gint fd_in = -1;
>  
>          ret = g_shell_parse_argv(filter, &argc, &argv, &error);
>  
> -- 
> 2.14.3
> 
> _______________________________________________
> 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: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180312/7b821a17/attachment.sig>


More information about the Spice-devel mailing list