Re: Unused header file inclusion

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Unused header file inclusion
Дата
Msg-id 20190731152322.GA30941@alvherre.pgsql
обсуждение исходный текст
Ответ на Unused header file inclusion  (vignesh C <vignesh21@gmail.com>)
Ответы Re: Unused header file inclusion  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 2019-Jul-31, vignesh C wrote:

> I noticed that there are many header files being
> included which need not be included.

Yeah, we have tooling for this already in src/tools/pginclude.  It's
been used before, and it has wreaked considerable havoc; see "git log
--grep pgrminclude".

I think doing this sort of cleanup is useful to a point -- as Andres
mentions, some includes are somewhat more "important" than others, so
judgement is needed in each case.

I think removing unnecessary include lines from header files is much
more useful than from .c files.  However, nowadays even I am not very
convinced that that is a very fruitful use of time, since many/most
developers use ccache which will reduce the compile times anyway in many
cases; and development machines are typically much faster than ten years
ago.

Also, I think addition of new include lines to existing .c files should
be a point worth specific attention in patch review, to avoid breaking
reasonable modularity boundaries unnecessarily.

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



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: How to retain lesser paths at add_path()?
Следующее
От: Andres Freund
Дата:
Сообщение: Re: partition routing layering in nodeModifyTable.c