Re: cleanup in code

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: cleanup in code
Дата
Msg-id 13123.1389108023@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: cleanup in code  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: cleanup in code  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I think it will be like Andres said up thread, to stop multiple evaluations
> of the expression passed to the macro.

Exactly.  We are not going to risk multiple evals in a macro as commonly
used as elog/ereport; the risk/benefit ratio is just too high.

I don't see anything wrong with suppressing this warning by inserting
an additional return statement.  The code is already plastered with such
things, from the days before we had any unreachability hints in
elog/ereport.  And as I said upthread, there is no good reason to suppose
that the unreachability hints are always recognized by every compiler.
I take this behavior of MSVC as proof of that statement.

It is mildly curious that MSVC fails to understand the unreachability hint
here when it does so elsewhere, but for our purposes, that's a purely
academic question.
        regards, tom lane



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

Предыдущее
От: Christoph Berg
Дата:
Сообщение: extra_float_digits and casting from real to numeric
Следующее
От: Andres Freund
Дата:
Сообщение: Re: generic pseudotype IO functions?