From owner-svn-src-head@FreeBSD.ORG Mon Apr 20 07:44:14 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22C64106566C; Mon, 20 Apr 2009 07:44:14 +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 B25B18FC17; Mon, 20 Apr 2009 07:44:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-107-120-227.carlnfd1.nsw.optusnet.com.au (c122-107-120-227.carlnfd1.nsw.optusnet.com.au [122.107.120.227]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id n3K7i8x4003345 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 20 Apr 2009 17:44:09 +1000 Date: Mon, 20 Apr 2009 17:44:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Robert Watson In-Reply-To: <200904192303.n3JN3v9w023289@svn.freebsd.org> Message-ID: <20090420171843.A58020@delplex.bde.org> References: <200904192303.n3JN3v9w023289@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r191292 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 20 Apr 2009 07:44:14 -0000 On Sun, 19 Apr 2009, Robert Watson wrote: > Log: > Explicitly include machine/param.h for CACHE_LINE_SIZE. > > MFC after: 2 weeks > > Modified: > head/libexec/rtld-elf/rtld_lock.c It is a style bug (unwarranted chumminess with the implementation) to include (or otherwise refer to) machine/param.h directly in *.c. This is only the 5th instance of this style bug in all of /usr/src. The previous ones are: % ./contrib/tcsh/sh.time.c:# include % ./lib/libc/stdlib/malloc.c:#include % ./sys/kern/subr_pcpu.c: * - The platform sets the value of MAXCPU in . % ./sys/mips/mips/stack_machdep.c:#include Similarly in MI code that is not sys/param.h, except for 1 exception: % ./gnu/lib/libstdc++/config.h:/* Define to 1 if you have the header file. */ % ./contrib/libstdc++/libmath/mathconf.h:# include % ./contrib/binutils/bfd/hosts/decstation.h:/* Hopefully this should include either machine/param.h (Ultrix) or % ./contrib/binutils/bfd/hosts/mipsbsd.h:#include % ./contrib/binutils/bfd/hosts/i386bsd.h:#include % ./contrib/gdb/gdb/config/mips/xm-mips.h:// OBSOLETE #include Contribed code certainly shouldn't know the implementation details. It might have ifdefs for this, with machine/param.h not being an implementation detail on some systems, but the includes in *bsd.h are probably wrong since bsd is not such a system. % ./sys/dev/drm/drmP.h:#include % ./sys/i386/include/xen/xen-os.h:#include Probably just wrong. % ./sys/sys/param.h:#include This is the public interface. % ./sys/sys/socket.h:#include This one is correct. It needs to include specially to get a small subset to avoid namespace pollution in the standard header sys/socket.h. This reason doesn't apply in any other cases. BTW, the #defines of __HAVE_ACPI and __PCI_REROUTE_INTERRUPT are unsorted more than most, at least in i386/include/param.h -- they are unsorted outside of the normal _FOO_H_ include guard. Bruce