Re: [PATCH] Add transforms feature - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCH] Add transforms feature
Date
Msg-id 21814.1418624350@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCH] Add transforms feature  (Peter Eisentraut <peter_e@gmx.net>)
List 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 by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Add transforms feature
Next
From: Michael Paquier
Date:
Subject: Re: Commit fest 2014-12, let's begin!