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 1kXDoA-0003Hb-8W for pgsql-committers@arkaria.postgresql.org; Tue, 27 Oct 2020 01:29:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXDo9-0001C5-7l for pgsql-committers@arkaria.postgresql.org; Tue, 27 Oct 2020 01:29:53 +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 1kXDo9-0001Bs-2Y for pgsql-committers@lists.postgresql.org; Tue, 27 Oct 2020 01:29:53 +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 1kXDo6-0002gX-Vg for pgsql-committers@lists.postgresql.org; Tue, 27 Oct 2020 01:29:52 +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 09R1Tkdb913283; Mon, 26 Oct 2020 21:29:46 -0400 From: Tom Lane To: Michael Paquier cc: Alvaro Herrera , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Extend PageIsVerified() to handle more custom options In-reply-to: <20201027001801.GA28445@paquier.xyz> References: <20201026143933.GA5304@alvherre.pgsql> <20201027001801.GA28445@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Tue, 27 Oct 2020 09:18:01 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <913281.1603762186.1@sss.pgh.pa.us> Date: Mon, 26 Oct 2020 21:29:46 -0400 Message-ID: <913282.1603762186@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > On Mon, Oct 26, 2020 at 11:39:33AM -0300, Alvaro Herrera wrote: >> Please remember that in the macro definition, the arguments should be >> enclosed in parens. No bug here at present, but it seems better to be >> cautious. > Indeed, I can see similar changes in the history of the tree. Do you > think that doing something like the attached is sufficient? Hm, I suspect what Alvaro meant was #define PageIsVerified(page, blkno) \ - PageIsVerifiedExtended(page, blkno, \ + PageIsVerifiedExtended((page), (blkno), \ But IMV that's not necessary: if the argument parsed as a single function/macro argument before, it still will do so. The places where you have to be careful to add parentheses are where the macro argument is used as part of a larger expression that is not just a function/macro argument. regards, tom lane