Thread
Commits
-
Fix misuse of an integer as a bool.
- e3bf3c0f8c9c 10.9 landed
- ddf927fb1347 12.0 landed
- 8eaba0b93da1 9.6.14 landed
- 6b0e9411ff0f 11.4 landed
- 0ec3d2ab250e 9.5.18 landed
-
BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
The Post Office <noreply@postgresql.org> — 2019-05-13T08:56:54Z
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); -
Re: BUG #15802: Comparison of a function returning boolean value using relational (<, >, <= or >=) operator
Tom Lane <tgl@sss.pgh.pa.us> — 2019-05-13T13:49:53Z
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