Re: Proposal: Add more compile-time asserts to exposeinconsistencies.

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Proposal: Add more compile-time asserts to exposeinconsistencies.
Дата
Msg-id 20190918074019.GA22307@paquier.xyz
обсуждение исходный текст
Ответ на Proposal: Add more compile-time asserts to expose inconsistencies.  ("Smith, Peter" <peters@fast.au.fujitsu.com>)
Ответы Re: Proposal: Add more compile-time asserts to expose inconsistencies.  (ilmari@ilmari.org (Dagfinn Ilmari Mannsåker))
RE: Proposal: Add more compile-time asserts to exposeinconsistencies.  ("Smith, Peter" <peters@fast.au.fujitsu.com>)
Список pgsql-hackers
On Wed, Sep 18, 2019 at 06:46:24AM +0000, Smith, Peter wrote:
> I have identified some OSS code where more compile-time asserts could be added.
>
> Mostly these are asserting that arrays have the necessary length to
> accommodate the enums that are used to index into them.
>
> In general the code is already commented with warnings such as:
> * "If you add a new entry, remember to ..."
> * "When modifying this enum, update the table in ..."
> * "Display names for enums in ..."
> * etc.
>
> But comments can be accidentally overlooked, so adding the
> compile-time asserts can help eliminate human error.

For some of them it could help, and we could think about a better
location for that stuff than an unused routine.  The indentation of
your patch is weird, with "git diff --check" complaining a lot.

If you want to discuss more about that, could you add that to the next
commit fest?  Here it is:
https://commitfest.postgresql.org/25/
--
Michael

Вложения

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

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: pgbench - allow to create partitioned tables
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: POC: Cleaning up orphaned files using undo logs