Include files that depend on include files
Giorgos Keramidas
keramida at linux.gr
Wed Aug 10 05:56:11 GMT 2005
On 2005-08-10 00:22, Dirk GOUDERS <gouders at et.bocholt.fh-ge.de> wrote:
>> This is intentational. We try to avoid having headers bring in more
>> then absolutly required when included. I'm not sure what your second
>> question means.
>
> With my second question I wanted to ask if this intention is only for
> kernel level code or a general one. I am asking this, because
> somewhen in a project that I was not actually participating in I heard
> or read a rule that roughly said: "all include files have to include
> all files they depend on and compile cleanly", but that project was on
> a user space program.
Well, first of all "include files" do not "compile". Then, there are
two different schools of thought on this matter:
a) the "purity and clean state of the namespace" school, and
b) the "keep the header files a userlevel program has to include as
few as possible" school
Both approaches have their advantages and drawbacks. AFAIK, in FreeBSD
the first is preferred.
- Giorgos
More information about the freebsd-hackers
mailing list