Subject: Re: proc.h
To: None <port-alpha@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-alpha
Date: 12/13/1999 22:26:39
> when a header file calls for a variable/definition defined externally
> shouldn't it then include the file which defines it?

You'd think so, but it seems not.

Personally, I think so.  And quite a while ago, I found that many of
NetBSD's include files didn't work this way: there were many include
files that, when included on their own, produced syntax errors.

When I proposed to fix this, I was, more or less, told it wasn't
broken, apparently because in at least a few cases, the documentation
for certain calls lists multiple files that need to be included.  I
don't quite follow how this makes the include files any less broken,
but....  So I've been just silently fixing them in my private patch
tree.

If you want a copy of that patch tree, I will be happy to send it.
(Those of you with access to cvs.netbsd.org can find it there in
~mouse/mouse-patch-tree.)

> E.g.: Use of <sys/proc.h> will fail if <sys/param.h> isn't included
> previously, as it uses external definitions such as MAXLOGNAME.

A good example - and my patch tree includes a patch for sys/sys/proc.h
(the file which is installed as <sys/proc.h>) that, among other things,
adds an include for <sys/param.h>.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B