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

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays
Дата
Msg-id 20191018121820.GY6962@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
Greetings,

* Thomas Munro (thomas.munro@gmail.com) wrote:
> On Tue, Oct 8, 2019 at 11:09 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> > I am personally still in the camp of people advocating the use of
> > macro for this purpose.  It is quite possible after reading your
> > points, some people might change their opinion or some others also
> > share their opinion against using a macro in which case we can drop
> > the idea of using a macro.
>
> -1 for these macros.

Agreed.

> These are basic facts about the C language.  I hope C eventually
> supports {} like C++, so that you don't have to think hard about
> whether the first member is another struct, and recursively so … but
> since the macros can't help with that problem, what is the point?

I realize that I need to don some fireproof gear for suggesting this,
but I really wonder how much fallout we'd have from just allowing {} to
be used..  It's about a billion[1] times cleaner and more sensible than
using {0} and doesn't create a dependency on what the first element of
the struct is..

Thanks,

Stephen

1: Detailed justification not included intentionally and is left as an
exercise to the reader.

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Clean up MinGW def file generation
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [Patch proposal] libpq portal support