Re: Remove redundant initializations

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Remove redundant initializations
Дата
Msg-id 555366.1625059697@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Remove redundant initializations  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Remove redundant initializations  (Noah Misch <noah@leadboat.com>)
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Tue, 29 Jun 2021 at 02:15, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The primary case where I personally rely on that style is when adding a
>> new field to a struct.  Currently it's possible to grep for some existing
>> field and add the new one beside it.  Leaving out initializations by
>> relying on side-effects of makeNode makes that far riskier.

> FWIW, I mostly grep for makeNode(NameOfNode) as I'm a bit mistrusting
> of if the random existing field name that I pick to grep for will
> properly showing me all the locations I should touch.

I tend to do that too, but it's not a foolproof thing either, since
some places use random memset's for the purpose.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Preventing abort() and exit() calls in libpq
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: cleaning up PostgresNode.pm