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

Поиск
Список
Период
Сортировка
От Isaac Morland
Тема Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Дата
Msg-id CAMsGm5cKhq-LGUjTopS4BpEUa7YMjon_Lbv2kyfmgkhWzXAefA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays  ("Joe Nelson" <joe@begriffs.com>)
Список 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 по дате отправления:

Предыдущее
От: vignesh C
Дата:
Сообщение: Re: Ordering of header file inclusion
Следующее
От: "Joe Nelson"
Дата:
Сообщение: Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays