[Spice-devel] [PATCH 06/22] Get rid of C-style memset initializations, use C++ style aggregates

Christophe de Dinechin cdupontd at redhat.com
Thu Mar 8 15:06:16 UTC 2018



> On 8 Mar 2018, at 12:42, Christophe Fergeau <cfergeau at redhat.com> wrote:
> 
> On Thu, Mar 08, 2018 at 05:39:48AM -0500, Frediano Ziglio wrote:
>>>> There are however still some issues:
>>>> - the syntax is using C++20 while we state we use C++11 syntax, this
>>>> is basically using C compatibility extensions. I just tried and for
>>>> instance this code is not accepted on Visual C++ 2015 (not an issue
>>>> at the moment);
>>> 
>>> No, but it is annoying. Will make that obvious in the commit log.
>>> 
>> 
>> I don't think that a comment on the log will make Visual C++
>> compile that code. Stating C++11 was the reason of this, not use too
>> advance syntax that could have problems.
> 
> For what it's worth, I'd be in favour of *not* using things newer than
> what is in c++11 (or maybe c++14), this would give some first guideline
> as to what's ok to use, and what should be avoided.

I agree.

However, we presently use gnu++11, so this is C++11 with GNU extensions.
As an extension, designated initializers have been in GCC since at least 4.7.

So do you think we should avoid GCC extensions and switch to “strict” mode?


Christophe


More information about the Spice-devel mailing list