Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke
Дата
Msg-id CAEepm=13KfNVsjzvdz_u4E_3_joAWfL+k6TNaFkr-=WTT_Ou=A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [COMMITTERS] pgsql: Add support for coordinating record typmods among parallel worke  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke
Re: [COMMITTERS] pgsql: Add support for coordinating record typmods among parallel worke
Список pgsql-committers
On Fri, Sep 15, 2017 at 3:45 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Thomas Munro <thomas.munro@enterprisedb.com> writes:
>> My compiler, C++ and more recent C standards are OK with identical
>> redefinition of a typedef like that, but not the older standards or
>> those particular compilers.  D'oh.  (I should figure out how to make
>> my automatic patch tester this fussy).  I think we should probably
>> just do this:
>
> Our usual locution for this sort of thing is to use
> "struct SharedRecordTypmodRegistry" in headers instead of
> the typedef name, if we don't want to pull in the header
> where the typedef is defined.  It might be all right to do
> what you suggest, but we've been burnt in the past by circular
> dependencies and/or pulling some header into essentially
> the entire build (which tends to lead to a mess down the road).
> I'd generally lean in the direction of not adding #includes to
> header files except where absolutely necessary.

Here's a version that just forward declares SharedRecordTypmodRegistry
in session.h (but keeps the typedef in typcache.h where it is useful
for shorter function prototypes).  Neither GCC 6 -Wall -std=c89 not
Clang -Wall -std=c89 complained about this problem.  I found an old
GCC 4.3 compiler and it complained about the typedef redefinition and
also the use of an anonymous union, also fixed in the attached.  Sorry
about that -- clearly I need to test my patches on more compilers in
future.

-- 
Thomas Munro
http://www.enterprisedb.com

-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Add support for coordinating record typmods among parallel worke
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Add support for coordinating record typmodsamong parallel worke