Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 2009 01:01:49 +0100
From:      Luigi Rizzo <rizzo@iet.unipi.it>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.org, Luigi Rizzo <luigi@FreeBSD.org>, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org
Subject:   Re: svn commit: r188578 - head/sys/netinet
Message-ID:  <20090215000149.GB95636@onelab2.iet.unipi.it>
In-Reply-To: <20090215052941.E2522@delplex.bde.org>
References:  <200902131514.n1DFEhft091837@svn.freebsd.org> <20090214183758.I847@besplex.bde.org> <20090214175136.GB89369@onelab2.iet.unipi.it> <20090215052941.E2522@delplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 15, 2009 at 06:39:56AM +1100, Bruce Evans wrote:
...
> BTW, I also disagree with you adding comments to include lines to say
> what the includes are for.  There is no chance that such comments are
> complete or can be maintained.  For completeness, every include line
> would need a paragraph or two like some of the ones in this mail to
> explain all the reasons why a header is included, and the details will
> change when code is added.  The reasons why a header is needed are
> most easily seen by trying to compile without it.  A generic header
> like <sys/types.h> will be needed for a myriad reasons and listing
> them all is not useful.  A small header will be needed for only a small
> number of reasons and listing them all is even less useful, since it
> is easy to find and understand the reasons if only a couple of
> declarations are used.

All true.
But I am only annotating "non-obvious" or questionable #include,
and only for the details relevant in the context of that
source file.
E.g. if I am including <net/if.h> just to know what IFNAMSIZ is,
or <net/route.h> just to get a forward declaration for 'struct route',
that's worth mentioning in my opinion, because those #includes
are possible candidates for removal once the required information
is obtained elsewhere (or it is not needed anymore).

	cheers
	luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090215000149.GB95636>