Re: [PATCH] Add transforms feature

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Add transforms feature
Дата
Msg-id 21814.1418624350@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Add transforms feature  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> On 4/4/14 6:21 PM, Andres Freund wrote:

> +    /* dependency on transform used by return type, if any */
> +    if ((trfid = get_transform_oid(returnType, languageObjectId, true)))

>> Should be compared to InvalidOid imo, rather than implicitly assuming
>> that InvalidOid evaluates to false.

> I think it's widely assumed that InvalidOid is false.

That's not the point; the point is that some nonzero number of compilers
(and probably Coverity too) will warn about this construct, on the not
unreasonable grounds that = might be a typo for ==.  (Those extra parens
might satisfy gcc, but not other tools.)  Please put in an explicit
comparison of the assignment result, as is done in approximately 100% of
the other places where this idiom appears in Postgres.
        regards, tom lane



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Add transforms feature
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Commit fest 2014-12, let's begin!