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 201DD0641B056142AC8C6645EC1B5F62014B927BAF@SYD1217
Whole thread Raw
In response to Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
From: Amit Kapila <amit.kapila16@gmail.com> Sent: Friday, 4 October 2019 4:50 PM

>>How about I just define them both the same?
>>#define INIT_ALL_ELEMS_ZERO     {0}
>>#define INIT_ALL_ELEMS_FALSE    {0}
>
>I think using one define would be preferred, but you can wait and see if others prefer defining different macros for
thesame thing.
 

While nowhere near unanimous, it seems majority favour using a macro (if only to protect the unwary and document the
behaviour).
And of those in favour of macros, using INIT_ALL_ELEMS_ZERO even for bool array is a clear preference.

So, please find attached the updated patch, which now has just 1 macro.

Kind Regards
--
Peter Smith
Fujitsu Australia

Attachment

pgsql-hackers by date:

Previous
From: Isaac Morland
Date:
Subject: Re: PATCH: Add uri percent-encoding for binary data
Next
From: Michael Paquier
Date:
Subject: Re: Two pg_rewind patches (auto generate recovery conf and ensureclean shutdown)