Re: Remove redundant initializations - Mailing list pgsql-hackers

From David Rowley
Subject Re: Remove redundant initializations
Date
Msg-id CAApHDvqW49yb6Lhto=DbHr0Ph2fgDcz5ae+TJPY=Nzqbj3+E=A@mail.gmail.com
Whole thread Raw
In response to Remove redundant initializations  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-hackers
On Mon, 28 Jun 2021 at 21:59, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> There are certain parts of code that laboriously initialize every field
> of a struct to (some spelling of) zero, even though the whole struct was
> just zeroed (by makeNode() or memset()) a few lines earlier.  Besides
> being redundant, I find this hard to read in some situations because
> it's then very hard to tell what is different between different cases or
> branches.

Just for information, there was a similar proposal in [1].  There were
some arguments for and against the idea. Might be worth reviewing.

David

[1]
https://www.postgresql.org/message-id/flat/CAFjFpRdmx2oWdCrYcQuk9CZ7S9iTrKSziC%3D%3D6j0Agw4jdmvLng%40mail.gmail.com#ff36253217d67d5531f5b2017a0dbfd0



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Numeric multiplication overflow errors
Next
From: David Rowley
Date:
Subject: Re: Deadlock risk while inserting directly into partition?