RE: Proposal: Make use of C99 designated initialisers fornulls/values arrays

Поиск
Список
Период
Сортировка
От Smith, Peter
Тема RE: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Дата
Msg-id 201DD0641B056142AC8C6645EC1B5F62014B91E62F@SYD1217
обсуждение исходный текст
Ответ на Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
-----Original Message-----
From: Tom Lane <tgl@sss.pgh.pa.us> Sent: Thursday, 3 October 2019 1:46 AM

> Right.  I think that in general it's bad practice for an initializer to not specify all fields/elements of the
target.
> It is okay in the specific case that we're substituting for a memset(..., 0, ...).
> Perhaps we could make this explicit by using a coding style like
>
>/* in c.h or some such place: */
>#define INIT_ALL_ZEROES  {0}
>
>/* in code: */
>    Datum values[N] = INIT_ALL_ZEROES;

The patch has been updated per your suggestion. Now using macros for these partial initialisers.

Please see attachment.

Kind Regards
---
Peter Smith
Fujitsu Australia

Вложения

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

Предыдущее
От: Natarajan R
Дата:
Сообщение: Regarding extension
Следующее
От: Amit Khandekar
Дата:
Сообщение: Re: Minimal logical decoding on standbys