From owner-svn-src-head@freebsd.org Sun Aug 2 04:10:43 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD1539AF744; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF4E1B66; Sun, 2 Aug 2015 04:10:43 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id C4C2310406B6; Sun, 2 Aug 2015 14:10:34 +1000 (AEST) Date: Sun, 2 Aug 2015 14:10:33 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John-Mark Gurney cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r286168 - head/sys/net In-Reply-To: <201508020015.t720Fr6R018929@repo.freebsd.org> Message-ID: <20150802133842.N894@besplex.bde.org> References: <201508020015.t720Fr6R018929@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=XMDNMlVE c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=z-DsBK8JfUJZqYZcnlkA:9 a=2pKiAXyLDbeUMeCR:21 a=tvztPCtJRzYOqW92:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2015 04:10:43 -0000 On Sun, 2 Aug 2015, John-Mark Gurney wrote: > Log: > convert to C11's _Static_assert, and pull in sys/cdefs.h for > compatibility w/ older non-C11 compilers... This include is bogus. already depends on the includer including other headers that include . Mainly . defined massive namespace pollution that includes everything in . It includes an infinite number of times via recursion, except the recursion is stopped by anti-reinclude guards. Th recursion makes the static number of nested includes of hard to count. Also, this is a kernel header. All kernel headers depend on the includer including and . Some work accidentally without this, and broken includers depend on this. For example, this file didn't depend on for the definition of CTASSERT() and wasn't broken when CTASSERT() was added, but if any includers of it that didn't include had there brokenness exposed. and defined much more massive namespace pollution than , together with some names that that are not pollution. Almost everything in is now part of the API. As a result, most kernel headers should not include . Some leaf headers like the x86 _types.h check that it is included before them. Some headers that are intentionally shared between the kernel and userland have a sloppy but non-polluting _KERNEL section that depends on many includes (mainly all the ones in and doesn't include anything explicitly, followed by a non-sloppy userland section that begins with an include of . This include used to be used for __BEGIN/__END_DECLS and __P(()) but is now just used for the former. Macros like __BEGIN/__END_DECLS and _Static_assert are just as ugly as __P(()) and should go away, but they have proliferated faster than __P(()) went away. The non-sloppyness includes not including but using basic types and declaring the few ufoo_t types that are part of the documented API of the header. If an application wants to abuse a kernel header, then it must fake the kernel environment for it. I don't know much about this header, but it is not documented in any man page so it can do anything. Bruce