[Spice-devel] [PATCH v4] tests: Fix compilation error

Frediano Ziglio fziglio at redhat.com
Wed Jan 4 13:39:21 UTC 2017


> 
> Fix compilation error due to -Werror=maybe-uninitialized:
> 
>   CC       test-display-base.o
> test-display-base.c: In function 'do_wakeup':
> test-display-base.c:579:13: error: 'update' may be used uninitialized...
>              push_command(&update->ext);
> 
> Signed-off-by: Snir Sheriber <ssheribe at redhat.com>
> ---
>  server/tests/test-display-base.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/server/tests/test-display-base.c
> b/server/tests/test-display-base.c
> index 8167df5..1a2a833 100644
> --- a/server/tests/test-display-base.c
> +++ b/server/tests/test-display-base.c
> @@ -573,7 +573,9 @@ static void produce_command(Test *test)
>                  update =
>                  test_spice_create_update_solid(command->solid.surface_id,
>                          command->solid.bbox, command->solid.color);
>                  break;
> -            default: /* Just to shut up GCC warning (-Wswitch) */
> +            default:
> +                    /* Terminate on unhandled cases - never actually reached
> */
> +                    g_assert_not_reached();
>                  break;
>              }
>              push_command(&update->ext);

Acked-by: Frediano Ziglio <fziglio at redhat.com>

I don't understand why g_assert_not_reached is not aligned with the break,
I assume some mail artifact.

Frediano


More information about the Spice-devel mailing list