From: Tom Lane <tgl@sss.pgh.pa.us>
To: dcb314@hotmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
Date: Mon, 13 May 2019 09:49:53 -0400
Message-ID: <16340.1557755393@sss.pgh.pa.us> (raw)
In-Reply-To: <15802-f0911a97f0346526@postgresql.org>
References: <15802-f0911a97f0346526@postgresql.org>
PG Bug reporting form <noreply@postgresql.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dcb314@hotmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
In-Reply-To: <16340.1557755393@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox