Re: allow benign typedef redefinitions (C11)

Поиск
Список
Период
Сортировка
От Álvaro Herrera
Тема Re: allow benign typedef redefinitions (C11)
Дата
Msg-id 202509281643.jcbwanjuy7yh@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: allow benign typedef redefinitions (C11)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: allow benign typedef redefinitions (C11)
Список pgsql-hackers
On 2025-Sep-28, Tom Lane wrote:

> =?UTF-8?Q?=C3=81lvaro_Herrera?= <alvherre@kurilemu.de> writes:
> > The changes to inet.h and varbit.h are surprising, but required.
> 
> Why?  Those headers compile now, and you've not removed any includes
> that they might indirectly depend on.

That's true.

> If what you mean is that some of the macros in these headers require
> varatt.h to be used, I do not agree that that means we should put
> varatt.h into these headers.  We've frequently relied on exactly
> that property of macro definitions to avoid excessive or circular
> inclusions.  Moreover, even if we wanted to change that policy,
> I know of no simple way to check it.

We used to have a script called pgdefine that would create a .c file
that would expand all macros defined in a header, and then ensure that
the C file compiled.  It was removed only recently (Dec. 2024), in
commit 5af699066f81, though it's true that apparently nobody had used in
a while.

> I think what we're trying to do here is reduce the #includes of
> header files to be just enough to compile the headers themselves.
> That will bleed out into more #include's required in .c files,
> but that's fine by me.

Ok, that requires adding varatt.h to just two .c files -- attached.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/

Вложения

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