Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: dcb314(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
Date: 2019-05-13 13:49:53
Message-ID: 16340.1557755393@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> postgresql-11.3/src/interfaces/libpq/fe-misc.c:1060]: (style) Comparison of
> a function returning boolean value using relational (<, >, <= or >=)
> operator.
> Source code is
> if (forRead && conn->ssl_in_use && pgtls_read_pending(conn) > 0)
> but
> ./src/interfaces/libpq/libpq-int.h:extern bool pgtls_read_pending(PGconn
> *conn);

It looks like the "> 0" belongs inside pgtls_read_pending, since
SSL_pending is documented to return an integer count. This is
probably harmless with C99-style bools, but if we were doing it
like that before PG v12, it could be a live bug in the back
branches. I'll check.

Thanks for the report!

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-05-13 13:54:09 Re: BUG #15803: Autocomplete issues in new 11.3 and 9.6.13 psql client
Previous Message Robert Schreiber 2019-05-13 09:36:30 Re: PostgreSQL 9.3.5 substring(text from pattern for escape) bug