Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfzSX-0008O5-NC for pgsql-hackers@arkaria.postgresql.org; Mon, 10 May 2021 06:32:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lfzSW-0001V7-KW for pgsql-hackers@arkaria.postgresql.org; Mon, 10 May 2021 06:32:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfzSW-0001UT-DA for pgsql-hackers@lists.postgresql.org; Mon, 10 May 2021 06:32:04 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfzSU-0003O4-C8 for pgsql-hackers@lists.postgresql.org; Mon, 10 May 2021 06:32:03 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 14A6W14o577207; Mon, 10 May 2021 02:32:01 -0400 From: Tom Lane To: Michael Paquier cc: Justin Pryzby , pgsql-hackers@lists.postgresql.org Subject: Re: strange case of "if ((a & b))" In-reply-to: References: <20210428182936.GE27406@telsasoft.com> <2896014.1619635209@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Mon, 10 May 2021 15:27:13 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <577205.1620628321.1@sss.pgh.pa.us> Date: Mon, 10 May 2021 02:32:01 -0400 Message-ID: <577206.1620628321@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Wed, Apr 28, 2021 at 02:40:09PM -0400, Tom Lane wrote: >> Agreed, but shouldn't we just drop the excess parens rather than >> doubling down on useless notation? > Using a notation like ((a & b) != 0) to enforce a boolean check after > the bitwise operation is the usual notation I've preferred, FWIW. Do > you mean something different here? Yeah --- the "!= 0" is pointless in the context of an if-test. regards, tom lane