On Thu, 11 Dec 2025 at 18:49, Uri Lublin <[email protected]> wrote:
>
>
>
> On Thu, Dec 11, 2025 at 2:38 PM Nicholas Vinson <[email protected]> wrote:
>>
>> On 12/11/25 06:55, Frediano Ziglio wrote:
>> > On Sun, 7 Dec 2025 at 12:20, Nicholas Vinson <[email protected]> wrote:
>> >>
>> >> When building with g++-16, the build fails with the following error:
>> >>
>> >>      server/tests/test-display-base.cpp:809:5: error: either all 
>> >> initializer
>> >>      clauses should be designated or none of them should be
>> >>
>> >> This is because g++-16 defaults to c++20 and when using designated
>> >> initializers with c++20, you don't wrap anonymous union fields with 
>> >> braces.
>> >>
>> >> Nicholas Vinson (2):
>> >>    m4/spice-compile-warnings.m4: disable -Wmissing-braces
>> >>    test-display-base.cpp: adjust designated init.
>> >>
>> >>   m4/spice-compile-warnings.m4       | 1 +
>> >>   server/tests/test-display-base.cpp | 2 +-
>> >>   2 files changed, 2 insertions(+), 1 deletion(-)
>> >>
>> >
>> > The CI is not that happy. I added some commit to make it pass:
>> > - missing AUTHORS for "make syntax-check"
>> > https://gitlab.freedesktop.org/fziglio/spice/-/commit/fb018b3fbb26f38b2ffb0ee569d4aafc287fc738
>> > - too old Fedora (not related to these changes)
>> > https://gitlab.freedesktop.org/fziglio/spice/-/commit/a4525e204ef8b7e3beb3709823029e27de633d7a
>> > - compatibility with pretty old GCC
>> > https://gitlab.freedesktop.org/fziglio/spice/-/commit/6a2c24fd5c088cb3b016a40965882e98f010b583
>
>
> Frediano, where did you take the 10 from ?
> Shouldn't it check if the gcc version is 16 (or even 20) ?
>

Hi,
   indeed not very scientific.
Given the initial reason of the change, why not

#if __cplusplus >= 202002L
    .attached_worker = attached_worker,
#else
    { .attached_worker = attached_worker },
#endif

?

>>
>>
>>
>> I'm concerned about the old GCC compatibility commit. I think it would
>> be more robust if designated initializer feature checks were added to
>> configure.ac and meson.build instead.
>>
>> That way you don't have to worry about how old or new the compiler is or
>> if it implements the necessary GCC extensions, or implements them correctly.
>

I think the above proposal also addresses this comment.

>
> Do you mean compiling a simple program with designated initializers in 
> meson/configure ?
>
> Regards,
>     Uri.
>
>
>>
>>
>> Regards,
>> Nicholas Vinson
>>

Frediano

>> >
>> > Do they sound good?
>> > I suppose the compatibility one could be merged.
>> >

Reply via email to