On Thu, Apr 6, 2017 at 5:07 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> Doesn't it also have the logic backwards? According to the comment,
> the attribute is dropped if the type *is* InvalidOid, so we want
> result == true in that case. But I don't actually know how to reach
> this code to test it.
You're right. So on this one line I had a reverse logic bug,
something that strict compilers would not accept, and code that
assumed that readers and compilers would always know that tests for
equality or inequality bind tighter than assignment.
I'll commit this fix first so I don't hold up Andres or break any
picky buildfarm critters and then see whether I can't manage to get
the tests to cover this code.
Thanks!
On Thu, Apr 6, 2017 at 5:16 PM, Andres Freund <andres@anarazel.de> wrote:
> On 2017-04-06 17:03:20 -0500, Kevin Grittner wrote:
>> Out of curiosity, what compiler or setting catches this?
>
> gcc-7 here, and the specific warning is -Wpointer-compare.
Thanks! I'll add that to my builds.
--
Kevin Grittner