On 8/3/23 22:54, Olaf Hering wrote:
> Thu, 3 Aug 2023 21:38:02 +0200 Michal Prívozník :
>
>> it looks like we're using { 0 } everywhere else so that's why I went with it.
>
> I was under the impression {} is valid. But apparently it is not,
> so I learned something new today: "ISO C forbids empty
Thu, 3 Aug 2023 21:38:02 +0200 Michal Prívozník :
> it looks like we're using { 0 } everywhere else so that's why I went with it.
I was under the impression {} is valid. But apparently it is not,
so I learned something new today: "ISO C forbids empty initializer braces".
Olaf
pgpbERjk73Jqj.pg
On 8/3/23 19:53, Olaf Hering wrote:
> Thu, 3 Aug 2023 12:36:08 +0200 Michal Privoznik :
>
>> +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_stand
Thu, 3 Aug 2023 12:36:08 +0200 Michal Privoznik :
> +vshControl _ctl = { 0 };
I see this often, instead of a simple 'type variable = {};',
and wonder what that zero is doing here?
Olaf
pgpesWu2O0JH7.pgp
Description: Digitale Signatur von OpenPGP
On 8/3/23 12:36, Michal Privoznik wrote:
> Both virsh and virt-admin have vshControl typed variables and
> also pointers to these variables. In both cases these are
> declared on a single line. Do the following:
>
> 1) break declaration into two lines,
> 2) use struct zero initializer for vshC
Both virsh and virt-admin have vshControl typed variables and
also pointers to these variables. In both cases these are
declared on a single line. Do the following:
1) break declaration into two lines,
2) use struct zero initializer for vshControl and
virshControl/vshAdmControl structs,