pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
2+ messages / 2 participants
[nested] [flat]
* BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
@ 2019-05-13 08:56 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2019-05-13 08:56 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: dcb314@hotmail.com
The following bug has been logged on the website:
Bug reference: 15802
Logged by: David Binderman
Email address: dcb314@hotmail.com
PostgreSQL version: 11.3
Operating system: Linux
Description:
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);
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
@ 2019-05-13 13:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2019-05-13 13:49 UTC (permalink / raw)
To: dcb314@hotmail.com; +Cc: pgsql-bugs@lists.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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2019-05-13 13:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 08:56 BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator PG Bug reporting form <noreply@postgresql.org>
2019-05-13 13:49 ` Tom Lane <tgl@sss.pgh.pa.us>
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