From owner-svn-src-projects@FreeBSD.ORG Wed Sep 30 10:59:09 2009 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3511B1065693; Wed, 30 Sep 2009 10:59:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id C6CAE8FC2D; Wed, 30 Sep 2009 10:59:08 +0000 (UTC) Received: from besplex.bde.org (c122-107-125-150.carlnfd1.nsw.optusnet.com.au [122.107.125.150]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n8UAx5TE011749 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 30 Sep 2009 20:59:06 +1000 Date: Wed, 30 Sep 2009 20:59:05 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Lawrence Stewart In-Reply-To: <200909300953.n8U9r3Oo011112@svn.freebsd.org> Message-ID: <20090930203736.D1368@besplex.bde.org> References: <200909300953.n8U9r3Oo011112@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r197638 - projects/tcp_ffcaia2008_8.x/sys/kern X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2009 10:59:09 -0000 On Wed, 30 Sep 2009, Lawrence Stewart wrote: > Log: > Alphabetically order includes. > ... > Modified: projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c > ============================================================================== > --- projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c Wed Sep 30 08:48:59 2009 (r197637) > +++ projects/tcp_ffcaia2008_8.x/sys/kern/kern_alq.c Wed Sep 30 09:53:03 2009 (r197638) > @@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$"); > #include "opt_mac.h" > > #include > -#include > +#include > +#include > +#include > #include > #include > #include > @@ -44,12 +46,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > -#include > -#include > +#include > ... should not be sorted alphabeticaly, since it declares things like KASSERT() and (by nested includes) hundreds of inline functions (especially ones in , and ) which are used in many other headers. It should be sorted immediately after where it was. Mis-sorting it is sometimes masked by namespace pollution in other headers. has the grossest namespace pollution despite me once completely cleaning it up :-(. It now includes and . ( is even more disgusting. It starts by including and says that this is "/* for NULL */", despite there being a whole header for the purpose of defining NULL and thus avoiding namespace which would be caused by defining NULL in a more central header, and despite it using _much_ more of than the definition of NULL.) But most headers aren't as bad. Thus sorting alphabetically (near the end) rarely works, and even when it works it is fragile and will break when a header sorted before it starts using KASSERT(). Bruce