----- Original Message ----- > From: "Michal Privoznik" <mprivozn@xxxxxxxxxx> > To: "Frediano Ziglio" <fziglio@xxxxxxxxxx> > Cc: spice-devel@xxxxxxxxxxxxxxxxxxxxx > Sent: Thursday, June 22, 2017 4:39:07 PM > Subject: Re: [PATCH server] tests: Initialize all members of SpiceBaseInterface struct > > On 06/22/2017 05:20 PM, Frediano Ziglio wrote: > >> > >> When compiling, -Werror=missing-field-initializers is enabled. > >> However, gcc fails to see that all the members of the > >> SpiceBaseInterface struct are initialized: > >> > >> test-display-base.c:844:5: error: missing initializer for field > >> 'description' of 'SpiceBaseInterface' > >> [-Werror=missing-field-initializers] .base.description = "test > >> spice virtual channel char device", > >> > > > > In my environment it compile without problems. Which compiler > > and version are you using? Can you add this information to the > > commit message? > > Sure: > > $ gcc --version > gcc (Gentoo 4.9.4 p1.0, pie-0.6.4) 4.9.4 > Copyright (C) 2015 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > Also, this is a gentoo box. I don't have a commit rights, so do you want me > to update the commit message and resend? Or will the commiter fix this > before pushing? > > Michal > You can update and post again or I can change before pushing it. What about, simply: ****** When compiling, -Werror=missing-field-initializers is enabled. However, some gcc versions (like Gentoo 4.9.4 one) fail to see that all the members of the SpiceBaseInterface struct are initialized: test-display-base.c:844:5: error: missing initializer for field 'description' of 'SpiceBaseInterface' [-Werror=missing-field-initializers] .base.description = "test spice virtual channel char device", The solution is to initialize .base member as a structure at once instead of multiple times per each member. Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> ****** Frediano _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel