Email List: Xaustin-group-lX
[All Lists]

Re: Re: one-header-per-function

To: yyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Re: one-header-per-function
From: David Korn <yyy@xxxxxxxxxxxxxxxx>
Date: Fri, 9 Jul 1999 14:42:30 -0400 (EDT)
> Donn:
> 
> > potentially several headers
> 
> Typically, this is  #include <sys/types.h>
> followed by  #include <foo.h>  for the function foo().
> 
> It is very desirable to state that the POSIX mandated
> headers can be included in any order. Once one says so,
> the  #include <foo.h>  cannot count on  <sys/types.h>
> being included already, so must include it itself.
> 
> So, as I see it, the goal is not `one include per function',
> but the goal is `independence of inclusion order', and
> a useful side effect is that one usually will have only
> one include per function. I do not think this useful
> side effect should be stated as a goal or requirement.
> 
> Andries
> 
> 

Order independence and one include file do not necessarily
yield the same results.

The question is whether including <sys/stat.h>, for example,
would allow all of the side effects of including <sys/types.h>
or not so that anything defined in <sys/types.h> could be visible.

I don't think that requiring order independence or requiring
a single include for any interface, does not allow the side
effects of including headers that the header you specify includes.

David Korn
research!dgk
yyy@xxxxxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>