Re: backend *.c #include cleanup (IWYU)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: backend *.c #include cleanup (IWYU)
Дата
Msg-id 202402122011.ywqycta5dohz@alvherre.pgsql
обсуждение исходный текст
Ответ на backend *.c #include cleanup (IWYU)  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
On 2024-Feb-10, Peter Eisentraut wrote:

> So as a test, I ran IWYU over the backend *.c files and removed all the
> #includes it suggested.  (Note that IWYU also suggests to *add* a bunch of
> #includes, in fact that is its main purpose; I didn't do this here.) In some
> cases, a more specific #include replaces another less specific one.

Sounds reasonable in principle.  I looked at the access/brin changes and
they seems OK.  Then I noticed the execdebug.h -> executor.h changes and
was surprised, until I looked at execdebug.h and though ... maybe we
should just get rid of that file altogether.

> Also, as a small example, in src/backend/access/transam/rmgr.c you'll see
> some IWYU pragma annotations to handle a special case there.

Looks pretty acceptable.

> The purpose of this patch is twofold: One, it's of course a nice cleanup.
> Two, this is a test how well IWYU might work for us.  If we find either by
> human interpretation that a change doesn't make sense, or something breaks
> on some platform, then that would be useful feedback (perhaps to addressed
> by more pragma annotations or more test coverage).

Apparently the tool has long standing, so since the results appear to be
good, I'm not opposed to adding it to our workflow.  Not as much as
pgindent for sure, though.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"All rings of power are equal,
But some rings of power are more equal than others."
                                 (George Orwell's The Lord of the Rings)



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: backend *.c #include cleanup (IWYU)
Следующее
От: "Amonson, Paul D"
Дата:
Сообщение: RE: Popcount optimization using AVX512