Date: Thu, 16 Feb 2012 02:19:37 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Gleb Smirnoff <glebius@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231760 - head/sys/netgraph Message-ID: <20120216015919.X2940@besplex.bde.org> In-Reply-To: <201202151426.q1FEQpn7065868@svn.freebsd.org> References: <201202151426.q1FEQpn7065868@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 15 Feb 2012, Gleb Smirnoff wrote: > Log: > style(9): sort includes. > Modified: head/sys/netgraph/ng_base.c > ============================================================================== > --- head/sys/netgraph/ng_base.c Wed Feb 15 14:23:01 2012 (r231759) > +++ head/sys/netgraph/ng_base.c Wed Feb 15 14:26:50 2012 (r231760) > @@ -43,25 +43,25 @@ > */ > > #include <sys/param.h> > -#include <sys/systm.h> systm was already sorted. Like param.h, it defines important macros that may be needed by other headers. For example, many headers use KASSERT(). KASSERT() happens to be a macro, so this happens to work if the other headers only use it in other macros, but this would fail if any of the other headers started using it in an inline functions. > #include <sys/ctype.h> > #include <sys/errno.h> errno.h is standard pollution in param.h. Including it directly is a style bug. This style bug was not very common. It was in 7 files in kern in 4.4BSD-Lite2, 1 in kern in FreeBSD-3 (after I fixed it in FreeBSD-2), 4 in kern in FreeBSD-4, and 8 in kern in -current. But in the top level directory of netgraph, it is in all 49 of 49 .c files in -current. > #include <sys/kdb.h> > #include <sys/kernel.h> > +#include <sys/kthread.h> > #include <sys/ktr.h> > #include <sys/limits.h> > #include <sys/lock.h> > #include <sys/malloc.h> > #include <sys/mbuf.h> > +#include <sys/proc.h> > #include <sys/queue.h> queue.h is nonstandard pollution in many headers. It has already been included (guarded) many times before here. Unfortunately, since it is nonstandard, this can't be depended on, though many .c files do. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120216015919.X2940>