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

Поиск
Список
Период
Сортировка
От Smith, Peter
Тема RE: Proposal: Add more compile-time asserts to exposeinconsistencies.
Дата
Msg-id 201DD0641B056142AC8C6645EC1B5F62014B9FB055@SYD1217
обсуждение исходный текст
Ответ на Re: Proposal: Add more compile-time asserts to exposeinconsistencies.  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: Proposal: Add more compile-time asserts to exposeinconsistencies.  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hello Michael,

> In short, attached is an updated version of your patch which attempts to solve that.  I have tested this with some
cplusplusstuff, and GCC for both versions (static_assert is available in GCC >= 6, but a manual change of c.h does the
trick).
> I have edited the patch a bit while on it, your assertions did not use project-style grammar, the use of parenthesis
wasinconsistent (see relpath.c for example), and pgindent has complained a bit. 

Thanks for your updates.

~~

Hello Andres,

>> +StaticAssertDecl(lengthof(LockTagTypeNames) == (LOCKTAG_ADVISORY + 1),
>> +                 "LockTagTypeNames array inconsistency");
>> +
> These error messages strike me as somewhat unhelpful. I'd probably just reword them as "array length mismatch" or
somethinglike that. 

I updated the most recent patch (_5 from Michael) so it now has your suggested error message rewording.

PSA patch _6

Kind Regards
----
Peter Smith
Fujitsu Australia

Вложения

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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] kqueue
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: How is this possible "publication does not exist"