Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQBL5-0002eE-Lu for pgsql-bugs@arkaria.postgresql.org; Mon, 13 May 2019 13:49:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQBL4-0002Qo-CM for pgsql-bugs@arkaria.postgresql.org; Mon, 13 May 2019 13:49:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQBL4-0002Qh-1U for pgsql-bugs@lists.postgresql.org; Mon, 13 May 2019 13:49:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQBL1-0006Nl-Qk for pgsql-bugs@lists.postgresql.org; Mon, 13 May 2019 13:49:56 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x4DDnrU1016341; Mon, 13 May 2019 09:49:53 -0400 From: Tom Lane 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 In-reply-to: <15802-f0911a97f0346526@postgresql.org> References: <15802-f0911a97f0346526@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 13 May 2019 08:56:54 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16339.1557755393.1@sss.pgh.pa.us> Date: Mon, 13 May 2019 09:49:53 -0400 Message-ID: <16340.1557755393@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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