Re: [HACKERS] Re: include-file cleanup - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re: include-file cleanup
Date
Msg-id 25717.932248292@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: include-file cleanup  (Bruce Momjian <maillist@candle.pha.pa.us>)
Responses Re: [HACKERS] Re: include-file cleanup
List pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> The problem is that we include system includes first.  Are there any
> system includes that require stdlib to be included first?

If so, they are supposed to include it for themselves.

Note: you can't really include ALL sys headers first, since some of them
need to be included conditionally, and the condition symbols are coming
from config.h...

> I have removed the duplicate system headers when postgres.h is included,
> and have added string.h and stdio.h to c.h, and have removed those from
> the files.  Now, many C files have _no_ system includes, because they
> come from postgres.h including c.h.

Sounds pretty good.

>> Also, I think some places include c.h without having included
>> postgres.h.  These should be checked to ensure that config.h has
>> been included first --- c.h depends on configuration symbols from
>> config.h to work properly.
>
> postgres.h include c.h, and config.h _now_ includes c.h.

OK, so then no .c files should be including c.h directly anymore?
Everything should include either postgres.h, or config.h if it's
not tightly tied to the system?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Merging old man pages
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: include-file cleanup