lkml.org 
[lkml]   [2002]   [Jul]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch,rfc] make depencies on header files explicit
On Fri, 5 Jul 2002, Sandy Harris wrote:

> I thought conventional wisdom was that header files should never #include
> other headers, and .c files should explicitly #include all headers they
> need.
>
> Googling on "nested header" turns up several style guides that agree:
> http://www.cs.mcgill.ca/resourcepages/indian-hill.html
> http://www.doc.ic.ac.uk/lab/secondyear/cstyle/node5.html
>
> and others that say it is controversial, can be done either way:
> http://www.eskimo.com/~scs/C-faq/q10.7.html
>
> Am I just off base in relation to kernel coding style? Or would getting
> rid of header file nesting be a useful objective.


Avoiding nested headers certainly results in the smallest set of header
files actually #included.
However, I think it's just not feasible with the kernel: many files would
start with a list of some hundred includes, and I can't imagine a
reasonable way to document the dependencies between them.

Tim

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:27    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog