Re: [PATCH 01/13] tools: Fix vshControl declaration and initialization

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

 



On 8/3/23 19:53, Olaf Hering wrote:
> Thu,  3 Aug 2023 12:36:08 +0200 Michal Privoznik <mprivozn@xxxxxxxxxx>:
> 
>> +    vshControl _ctl = { 0 };
> 
> I see this often, instead of a simple 'type variable = {};',
> and wonder what that zero is doing here?

That's C23 standard:

https://en.wikipedia.org/wiki/C23_(C_standard_revision)#Syntax

Libvirt requires C99 with GNU extensions which don't have that AFAIK.
OTOH, when turning on `-pedantic` compilation fails on the very first .c
file.

Anyway, it looks like we're using { 0 } everywhere else so that's why I
went with it. But switching to {} should be as easy as:

@@
@@
- { 0 }
+ {}

(untested spatch) Or maybe even a bit of sed trickery can do it.

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux