Re: do {} while (0) nitpick - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: do {} while (0) nitpick
Date
Msg-id acc4b12e-09a2-c527-aacf-3caa8fcf47ab@2ndQuadrant.com
Whole thread Raw
In response to do {} while (0) nitpick  (John Naylor <john.naylor@2ndquadrant.com>)
Responses Re: do {} while (0) nitpick  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 5/4/20 6:44 PM, Andrew Dunstan wrote:
> On 5/1/20 5:32 PM, Tom Lane wrote:
>> There are remaining instances of this antipattern in the flex-generated
>> scanners, which we can't do anything about; and in pl/plperl/ppport.h,
>> which we shouldn't do anything about because that's upstream-generated
>> code.  (I wonder though if there's a newer version available.)
>
> I'll take a look. It's more than 10 years since we updated it.
>
>


I tried this out with ppport.h from perl 5.30.2 which is what's on my
Fedora 31 workstation. It compiled fine, no warnings and the tests all
ran fine.


So we could update it. I'm just not sure there would be any great
benefit from doing so until we want to use some piece of perl API that
postdates 5.11.2, which is where our current file comes from.


I couldn't actually find an instance of the offending pattern in either
version of pport.h. What am I overlooking?


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services




pgsql-hackers by date:

Previous
From: Jeremy Schneider
Date:
Subject: Re: SEQUENCE values (duplicated) in some corner cases when crashhappens
Next
From: Andrew Dunstan
Date:
Subject: Re: Postgres Windows build system doesn't work with python installedin Program Files