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

From: "Smith, Peter" <peters(at)fast(dot)au(dot)fujitsu(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Joe Nelson <joe(at)begriffs(dot)com>, Isaac Morland <isaac(dot)morland(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Proposal: Make use of C99 designated initialisers for nulls/values arrays
Date: 2019-10-07 23:13:28
Message-ID: 201DD0641B056142AC8C6645EC1B5F62014B927BAF@SYD1217
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)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 the same 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 Content-Type Size
c99_init_nulls_4.patch application/octet-stream 85.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2019-10-08 02:51:40 Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown)
Previous Message Isaac Morland 2019-10-07 21:38:15 Re: PATCH: Add uri percent-encoding for binary data