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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: backend *.c #include cleanup (IWYU)
Дата
Msg-id 2356244.1707774415@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: backend *.c #include cleanup (IWYU)  (Peter Eisentraut <peter@eisentraut.org>)
Ответы Re: backend *.c #include cleanup (IWYU)  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> Approaches like that as well as the in-tree pgrminclude work by "I 
> removed the #include and it still compiled fine", which can be 
> unreliable.  IWYU on the other hand has the compiler tracking where a 
> symbol actually came from, and so if it says that an #include is not 
> used, then it's pretty much correct by definition.

Well, it might be correct by definition for the version of the code
that the compiler processed.  But it sounds to me like it's just as
vulnerable as pgrminclude to taking out #includes that are needed
only by #ifdef'd code sections that you didn't compile.

On the whole, our experience with automated #include removal is
pretty awful.  I'm not sure I want to go there again.

            regards, tom lane



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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Fix a typo in pg_rotate_logfile
Следующее
От: Pavel Luzanov
Дата:
Сообщение: Re: Psql meta-command conninfo+