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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Proposal: Add more compile-time asserts to exposeinconsistencies.
Дата
Msg-id 20200131054616.GD2631@paquier.xyz
обсуждение исходный текст
Ответ на Re: Proposal: Add more compile-time asserts to exposeinconsistencies.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Proposal: Add more compile-time asserts to exposeinconsistencies.
Список pgsql-hackers
On Fri, Jan 31, 2020 at 02:15:42PM +0900, Kyotaro Horiguchi wrote:
> As a cross check, it cleanly applied and worked as expected. The
> fallback definition of StaticAssertDecl for C worked for gcc 8.3.

Thanks for the review.

> - * Macros to support compile-time assertion checks.
> + * Macros to support compile-time and declaration assertion checks.
>
> All the StaticAssert things check compile-time assertion.  I think
> that the name StaticAssertDecl doesn't mean "declaration assertion",
> but means "static assertion as a declaration". Is the change needed?

Hmm.  Yeah, that sounds right.

> - * If the "condition" (a compile-time-constant expression) evaluates to false,
> - * throw a compile error using the "errmessage" (a string literal).
> + * If the "condition" (a compile-time-constant or declaration expression)
> + * evaluates to false, throw a compile error using the "errmessage" (a
> + * string literal).
>
> I'm not sure what the "declaration expression" here means.  I think
> the term generally means "a variable declaration in expressions",
> something like "r = y * (int x = blah)".  In that sense, the parameter
> for StaticAssertDecl is just a compile-time constant expression. Is it
> a right rewrite?

Actually, thinking more about it, I'd rather remove this part as well,
keeping only the change in the third paragraph of this comment block.
--
Michael

Вложения

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

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: standby apply lag on inactive servers
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: MSVC installs too much stuff?