Subject: Re: missing #include ?
To: None <tech-userlevel@NetBSD.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-userlevel
Date: 12/11/2006 15:42:49
On Mon, Dec 11, 2006 at 08:52:03AM -0500, D'Arcy J.M. Cain wrote:
> > This part always created a lot of grieve for me, as e.g. silent
> > dependencies are introduced due to the namespace pollution. Check for
> > missing includes e.g. of unistd.h in certain C++ programs in pkgsrc.
> 
> Namespace pollution may or may not be a problem with certain includes
> but that is a different issue not relevant to this one.  Whether the
> application includes both headers or it includes only one which in turn
> includes the second doesn't have any effect on the namespace issue.

It does. When one system does expose a header indirectly and a program
is written for it and relays on it and other Operating Systems don't do
that to preserver the clean namespace, they start to see lots of missing
prototypes etc. As written in this thread before, we already have a huge
bunch of such patches. When a program includes both, it works on either
system.

I should add that I'd prefer to get the header type save as well, which
might mean that e.g. u_long should die. I don't see the reason for it in
a public header anyway.

Joerg