Re: Unused header file inclusion

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Unused header file inclusion
Дата
Msg-id CA+hUKGJ4RjuST0=4afyHYfE=T6VQYqWPCcYOgkvRQEwbwOUOcQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Unused header file inclusion  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Unused header file inclusion  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Thu, Aug 8, 2019 at 9:00 AM Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> On 2019-Aug-05, Tom Lane wrote:
> > Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > > Then there's the <limits.h> removal, which is in tuplesort.c because of
> > > INT_MAX as added by commit d26559dbf356 and still present ...
> >
> > One has to be especially wary of removing system-header inclusions;
> > the fact that they don't seem to be needed on your own machine doesn't
> > prove they aren't needed elsewhere.
>
> As far as I can see, this line was just carried over from tuplestore.c,
> but that file uses INT_MAX and this one doesn't use any of those macros
> as far as I can tell.

Yeah, probably, or maybe I used one of those sorts of macros in an
earlier version of the patch.

By the way, I see now that I had put the offending #include <limits.h>
*after* project headers, which is a convention I picked up from other
projects, mentors and authors, but not what PostgreSQL usually does.
In my own code I do that to maximise the chances that project headers
will fail to compile if they themselves forget to include the system
headers they depend on.  Of course an attempt to compile every header
in the project individually as a transaction unit also achieves that.

/me runs away

-- 
Thomas Munro
https://enterprisedb.com



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

Предыдущее
От: Isaac Morland
Дата:
Сообщение: Re: Documentation clarification re: ANALYZE
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: Unused header file inclusion