Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Date
Msg-id 20191112193132.qwxtipgnpkulwwrq@alap3.anarazel.de
Whole thread Raw
In response to Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Michael Paquier <michael@paquier.xyz>)
Responses RE: Proposal: Make use of C99 designated initialisers fornulls/values arrays  ("Smith, Peter" <peters@fast.au.fujitsu.com>)
List pgsql-hackers
Hi,

On 2019-11-12 14:17:42 +0900, Michael Paquier wrote:
> On Tue, Oct 22, 2019 at 04:13:03PM +0530, Amit Kapila wrote:
> > Hmm, but then what is your suggestion for existing code that uses {0}.
> > If we reject this patch and leave the current code as it is, there is
> > always a risk of some people using {0} and others using memset which
> > will lead to further deviation in the code.  Now, maybe if we change
> > the existing code to always use memset where we use {0}, then we can
> > kind of enforce such a rule for future patch authors.
> 
> Well, we could have a shot at reducing the footprint of {0} then where
> we can.  I am seeing less than a dozen in contrib/, and a bit more
> than thirty in src/backend/.

-many. I think this serves zero positive purpose, except to make it
harder to analyze code-flow.

I think it's not worth going around to convert code to use {0} style
initializers in most cases, but when authors write it, we shouldn't
remove it either.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Coding in WalSndWaitForWal
Next
From: Andres Freund
Date:
Subject: Re: Missing dependency tracking for TableFunc nodes