RE: Proposal: Add more compile-time asserts to exposeinconsistencies.
| От | Smith, Peter |
|---|---|
| Тема | RE: Proposal: Add more compile-time asserts to exposeinconsistencies. |
| Дата | |
| Msg-id | 201DD0641B056142AC8C6645EC1B5F62014B9DA86E@SYD1217 обсуждение исходный текст |
| Ответ на | Re: Proposal: Add more compile-time asserts to exposeinconsistencies. (Andres Freund <andres@anarazel.de>) |
| Список | pgsql-hackers |
-----Original Message-----
From: Andres Freund <andres@anarazel.de> Sent: Tuesday, 3 December 2019 2:56 AM
> +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.
OK. I have no problem to modify all my current assertion messages to your suggested text ("array length mismatch") if
youthink it is better.
Please correct me if I am wrong, but I didn't think the error message text is of very great significance here because
itis a compile-time issue meaning the *only* person who would see the message is the 1 developer who accidentally
introduceda bug just moments beforehand. The compile will fail with a source line number, and when the developer sees
theStaticAssertDecl at that source line the cause of the error is anyway self-evident by the condition parameter.
Kind Regards
--
Peter Smith
Fujitsu Australia
В списке pgsql-hackers по дате отправления: