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

From Smith, Peter
Subject RE: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Date
Msg-id 201DD0641B056142AC8C6645EC1B5F62014B91E62F@SYD1217
Whole thread Raw
In response to Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Natarajan R
Date:
Subject: Regarding extension
Next
From: Amit Khandekar
Date:
Subject: Re: Minimal logical decoding on standbys