Subject: Re: missing #include ?
To: Joerg Sonnenberger <joerg@britannica.bec.de>
From: D'Arcy J.M. Cain <darcy@NetBSD.org>
List: tech-userlevel
Date: 12/11/2006 09:53:22
On Mon, 11 Dec 2006 15:42:49 +0100
Joerg Sonnenberger <joerg@britannica.bec.de> wrote:
> > 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.

Right.  Be aggresively portable both on the OS side and the application
side.  Nothing prevents that.  Add the second header to your app so
that it works on other OSs and add the second header to our header so
that third party code doesn't fail under NetBSD.  This discussion is
concerned with the latter.

> 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.

Yah, that has always annoyed me too.  It falls into the same category
as "#define SEVEN 7" for me.  I mean, what the heck would u_long ever
be redefined as?

-- 
D'Arcy J.M. Cain <darcy@NetBSD.org>
http://www.NetBSD.org/