From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Sandy Harris <pashley@storm.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch,rfc] make depencies on header files explicit
Date: Fri, 5 Jul 2002 17:58:37 +1000 [thread overview]
Message-ID: <20020705175837.137f2479.sfr@canb.auug.org.au> (raw)
In-Reply-To: <3D253AAE.D73E1E07@storm.ca>
Hi Sandy,
On Fri, 05 Jul 2002 02:20:30 -0400 Sandy Harris <pashley@storm.ca> wrote:
>
> I thought conventional wisdom was that header files should never #include
> other headers, and .c files should explicitly #include all headers they
> need.
Conventional wisdom varies depending on whose conventions you are asking :-)
> 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
Yes, well I know it is controversial ...
> Am I just off base in relation to kernel coding style? Or would getting
> rid of header file nesting be a useful objective.
The CodingStyle file is silent on this.
I just find it a real pain sometimes trying to figure out what other
include files I need to when all I really want is one or two definitions
in one particular include file. The same holds true when I am removing
or moving stuff from one place to another (especially when trying to
clean up some of the current mess).
Given that all kernel header files protect themselves from being included
multiple times, I think locality wins us something.
As I said, this is (just) my (humble) opinion. :-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
next prev parent reply other threads:[~2002-07-05 7:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-03 21:45 Tim Schmielau
2002-07-05 1:12 ` Stephen Rothwell
2002-07-05 6:20 ` Sandy Harris
2002-07-05 7:58 ` Stephen Rothwell [this message]
2002-07-06 0:39 ` Tim Schmielau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020705175837.137f2479.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=pashley@storm.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®