Re: pgsql: Extend PageIsVerified() to handle more custom options - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Extend PageIsVerified() to handle more custom options
Date
Msg-id 913282.1603762186@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Extend PageIsVerified() to handle more custom options  (Michael Paquier <michael@paquier.xyz>)
List pgsql-committers
Michael Paquier <michael@paquier.xyz> 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



pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Extend PageIsVerified() to handle more custom options
Next
From: Bruce Momjian
Date:
Subject: pgsql: doc: simplify wording of function error affects