From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCH] Add transforms feature |
Date: | 2014-12-15 06:19:10 |
Message-ID: | 21814.1418624350@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Peter Eisentraut <peter_e(at)gmx(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2014-12-15 06:37:07 | Re: Commit fest 2014-12, let's begin! |
Previous Message | Peter Eisentraut | 2014-12-15 06:10:36 | Re: [PATCH] Add transforms feature |