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

2023-08-04 Thread Claudio Fontana
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

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

2023-08-03 Thread Olaf Hering
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

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

2023-08-03 Thread Michal Prívozník
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

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

2023-08-03 Thread Olaf Hering
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

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

2023-08-03 Thread Claudio Fontana
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

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

2023-08-03 Thread Michal Privoznik
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,