Re: do {} while (0) nitpick

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Steele <david(at)pgmasters(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, John Naylor <john(dot)naylor(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: do {} while (0) nitpick
Date: 2020-05-06 22:28:46
Message-ID: b36ad98b-cb2c-2898-8157-bd1b93bad632@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 5/6/20 3:24 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com> writes:
>> 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.
> Yeah, perhaps not. Given our general desire not to break old toolchains,
> it might be a long time before we want to require any new Perl APIs.
>
>> I couldn't actually find an instance of the offending pattern in either
>> version of pport.h. What am I overlooking?
> My script was looking for any macro ending with ';', so it found these:
>
> #define START_MY_CXT static my_cxt_t my_cxt;
>
> # define XCPT_TRY_END JMPENV_POP;
>
> # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
>
> Those don't seem like things we'd use directly, so it's mostly moot.

Yeah. My search was too specific.

The modern one has these too :-(

> BTW, I looked around and could not find a package-provided ppport.h
> at all on my Red Hat systems. What package is it in?

perl-Devel-PPPort contains a perl module that will write the file for
you like this:

perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile();'

cheers

andrew

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2020-05-06 22:39:01 Re: do {} while (0) nitpick
Previous Message Robert Haas 2020-05-06 22:02:26 Re: pg_basebackup misses to report checksum error