Re: do {} while (0) nitpick

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: do {} while (0) nitpick
Дата
Msg-id b36ad98b-cb2c-2898-8157-bd1b93bad632@2ndQuadrant.com
обсуждение исходный текст
Ответ на Re: do {} while (0) nitpick  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: do {} while (0) nitpick  (David Steele <david@pgmasters.net>)
Список pgsql-hackers
On 5/6/20 3:24 PM, Tom Lane wrote:
> Andrew Dunstan <andrew.dunstan@2ndquadrant.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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: pg_basebackup misses to report checksum error
Следующее
От: David Steele
Дата:
Сообщение: Re: do {} while (0) nitpick