Re: [PATCH spice-gtk] Use designated struct initializer

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

 



On Fri, Jul 07, 2017 at 04:26:33PM +0200, Pavel Grunt wrote:
> Silence -Wmissing-field-initializers warnings.

This doesn't make sense for many of these cases you've changed

> diff --git a/src/channel-main.c b/src/channel-main.c
> index 4edd575..104b18a 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -1275,7 +1275,7 @@ static void agent_sync_audio_record(SpiceMainChannel *main_channel)
>  static void agent_display_config(SpiceMainChannel *channel)
>  {
>      SpiceMainChannelPrivate *c = channel->priv;
> -    VDAgentDisplayConfig config = { 0, };
> +    VDAgentDisplayConfig config = { .flags = 0, .depth = 0};

eg "{ 0 }" is explicitly defined in the C spec as meaning initialize every
field to all zeros. 

GCC would complain about { 1 }, but should never complain about { 0 }, even
with -Wmissing-field-initializers.



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
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]