Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Zenghui Yu
On 2021/3/3 18:17, Daniel P. Berrangé wrote: This is a bit wierd. There should only be risk of uninitialized variable if there is a 'return' or 'goto' statement between the variable declaration and and initialization, which is not the case in either scenario here. What OS distro and compiler +

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Jag Raman
> On Mar 3, 2021, at 9:26 AM, Daniel P. Berrangé wrote: > > On Wed, Mar 03, 2021 at 02:24:04PM +, Jag Raman wrote: >> >> >>> On Mar 3, 2021, at 5:17 AM, Daniel P. Berrangé wrote: >>> >>> On Wed, Mar 03, 2021 at 03:06:39PM +0800, Zenghui Yu wrote: Quote docs/devel/style.rst (section

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Daniel P . Berrangé
On Wed, Mar 03, 2021 at 02:24:04PM +, Jag Raman wrote: > > > > On Mar 3, 2021, at 5:17 AM, Daniel P. Berrangé wrote: > > > > On Wed, Mar 03, 2021 at 03:06:39PM +0800, Zenghui Yu wrote: > >> Quote docs/devel/style.rst (section "Automatic memory deallocation"): > >> > >> * Variables declared

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Jag Raman
> On Mar 3, 2021, at 5:17 AM, Daniel P. Berrangé wrote: > > On Wed, Mar 03, 2021 at 03:06:39PM +0800, Zenghui Yu wrote: >> Quote docs/devel/style.rst (section "Automatic memory deallocation"): >> >> * Variables declared with g_auto* MUST always be initialized, >> otherwise the cleanup functio

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Philippe Mathieu-Daudé
On 3/3/21 11:17 AM, Daniel P. Berrangé wrote: > On Wed, Mar 03, 2021 at 03:06:39PM +0800, Zenghui Yu wrote: >> Quote docs/devel/style.rst (section "Automatic memory deallocation"): >> >> * Variables declared with g_auto* MUST always be initialized, >> otherwise the cleanup function will use unini

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Daniel P . Berrangé
On Wed, Mar 03, 2021 at 03:06:39PM +0800, Zenghui Yu wrote: > Quote docs/devel/style.rst (section "Automatic memory deallocation"): > > * Variables declared with g_auto* MUST always be initialized, > otherwise the cleanup function will use uninitialized stack memory > > Initialize @name properl

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Philippe Mathieu-Daudé
Hi, On 3/3/21 8:06 AM, Zenghui Yu wrote: > Quote docs/devel/style.rst (section "Automatic memory deallocation"): > > * Variables declared with g_auto* MUST always be initialized, > otherwise the cleanup function will use uninitialized stack memory > > Initialize @name properly to get rid of th

Re: [PATCH] multi-process: Initialize variables declared with g_auto*

2021-03-03 Thread Jag Raman
> On Mar 3, 2021, at 2:06 AM, Zenghui Yu wrote: > > Quote docs/devel/style.rst (section "Automatic memory deallocation"): > > * Variables declared with g_auto* MUST always be initialized, > otherwise the cleanup function will use uninitialized stack memory > > Initialize @name properly to g