pgsql: Improve unreachability recognition in elog() macro.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Improve unreachability recognition in elog() macro.
Дата
Msg-id E1biqEW-0002ZW-Ls@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Improve unreachability recognition in elog() macro.

Some experimentation with an older version of gcc showed that it is able
to determine whether "if (elevel_ >= ERROR)" is compile-time constant
if elevel_ is declared "const", but otherwise not so much.  We had
accounted for that in ereport() but were too miserly with braces to
make it so in elog().  I don't know how many currently-interesting
compilers have the same quirk, but in case it will save some code
space, let's make sure that elog() is on the same footing as ereport()
for this purpose.

Back-patch to 9.3 where we introduced pg_unreachable() calls into
elog/ereport.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/0db3c5552a16c0e73e0c24a36a3bacc77820bf02

Modified Files
--------------
src/include/utils/elog.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve unreachability recognition in elog() macro.
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Implement binary heap replace-top operation in a smarter way.