From owner-svn-src-all@FreeBSD.ORG Tue Nov 20 07:04:03 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67351367; Tue, 20 Nov 2012 07:04:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id E38998FC08; Tue, 20 Nov 2012 07:04:02 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id qAK73vLT008767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Nov 2012 18:03:59 +1100 Date: Tue, 20 Nov 2012 18:03:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler Subject: Re: svn commit: r243321 - head/usr.sbin/edquota In-Reply-To: <201211200212.qAK2C1sT097754@svn.freebsd.org> Message-ID: <20121120172226.R1115@besplex.bde.org> References: <201211200212.qAK2C1sT097754@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=XbrRV/F5 c=1 sm=1 a=ZxRWe08iPxcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=jzXQl5q7vI0A:10 a=Z2WMB8SLCj99l0N3Wx0A:9 a=CjuIK1q_8ugA:10 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2012 07:04:03 -0000 On Tue, 20 Nov 2012, Eitan Adler wrote: > Log: > Remove unneeded includes. > > Tested with "make universe"; there are no conditional features. "make universe" can't find such features. Except inversely -- when it doesn't find them, it usually means that there is a bug in the headers. > Modified: head/usr.sbin/edquota/edquota.c > ============================================================================== > --- head/usr.sbin/edquota/edquota.c Tue Nov 20 01:57:21 2012 (r243320) > +++ head/usr.sbin/edquota/edquota.c Tue Nov 20 02:12:01 2012 (r243321) > @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); > * Disk quota editor. > */ > > -#include > -#include > #include > #include > #include > This removes used includes. is a documented prerequisite of . sys/mount.h has some pollution but not that until recently. has included for a long time, and someone recently added the following disgusting pollution to : - includes - includes and all of its standard pollution According to cc -E -MM, this is: % f.o: f.c /usr/include/bsm/audit.h /usr/include/sys/param.h \ ^^^^^^^^^^^^^^^^^^^^^^^^ Polluting headers are underlined. % /usr/include/sys/_null.h /usr/include/sys/types.h \ ^^^^^^^^^^^^^^^^^^^^^^^^ is of low quality. It also includes after . This is a style bug. is standard pollution in . % /usr/include/sys/cdefs.h /usr/include/machine/endian.h \ % /usr/include/x86/endian.h /usr/include/sys/_types.h \ % /usr/include/machine/_types.h /usr/include/x86/_types.h \ % /usr/include/sys/_pthreadtypes.h /usr/include/sys/_stdint.h \ % /usr/include/sys/select.h /usr/include/sys/_sigset.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollution in . % /usr/include/sys/_timeval.h /usr/include/sys/timespec.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollution in . % /usr/include/sys/_timespec.h /usr/include/sys/syslimits.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/sys/signal.h /usr/include/machine/_limits.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in . % /usr/include/x86/_limits.h /usr/include/machine/signal.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/machine/trap.h /usr/include/x86/trap.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in and thus in . % /usr/include/machine/param.h /usr/include/machine/_align.h \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ % /usr/include/x86/_align.h /usr/include/sys/limits.h ^^^^^^^^^^^^^^^^^^^^^^^^^ Standard pollutions in . To remove a single header, you must know all the standard pollutions and check cc -E -MM output to verify that no nonstandard pollutions are depended on. That was for . Now for some others. > -#include > -#include > #include a is documented prerequisite for . It was correct to get it via . However, is a POSIX header. POSIX required before in 1988, but removed this requirement in 2001 or before. FreeBSD is slowly catching up with this: - FreeBSD has always been massively polluted by including and all if its pollution (which includes . The polluting became unnecessary in about 1995 and is mostly fixed in my version (I include instead). - FreeBSD man pages were originally very inconsistent about documenting the prereq. It wasn't ever a prereq in FreeBSD, but was required for portability. None documented this of course. - At about the same time that POSIX removed the prereq, lots of man pages were "fixed" to document the old POSIX prereq. - man pages (e.g., stat(2)) still document the old POSIX prereq. More code than before probably doesn't satisfy this. is documented as having no prereqs (in flock(2)). It satisfies this by polluting itself with and other includes. The pollution is not documented of course. So this commit is correct for and except it depends on undocumented details for the former. Bruce