svn commit: r188578 - head/sys/netinet
Luigi Rizzo
rizzo at iet.unipi.it
Sat Feb 14 15:55:49 PST 2009
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
More information about the svn-src-all
mailing list