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

From Isaac Morland
Subject Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Date
Msg-id CAMsGm5cKhq-LGUjTopS4BpEUa7YMjon_Lbv2kyfmgkhWzXAefA@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays  ("Joe Nelson" <joe@begriffs.com>)
List pgsql-hackers
On Mon, 21 Oct 2019 at 11:46, Chapman Flack <chap@anastigmatix.net> wrote:

I would favor {} in a heartbeat if it were standard, because that
sucker is an idiom.

Failing that, though, I think I still favor the macro, because
question (1) seems less fuzzy than question (2), and on "clear",
the macro wins.

Is it possible to define the macro to be {} where supported and {0} where needed? Something like:

#if ...
#define INIT_ALL_ELEMS_ZERO {}
#else
#define INIT_ALL_ELEMS_ZERO {0}
#endif

Then it's clear the 0 is just there to make certain compilers happy and doesn't have any actual meaning.

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Ordering of header file inclusion
Next
From: "Joe Nelson"
Date:
Subject: Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays