From owner-svn-src-all@FreeBSD.ORG Sat Feb 15 18:59:22 2014 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAB65EEB; Sat, 15 Feb 2014 18:59:22 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 765411029; Sat, 15 Feb 2014 18:59:22 +0000 (UTC) Received: from [192.168.0.7] (cpc28-cmbg15-2-0-cust64.5-4.cable.virginm.net [86.27.189.65]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s1FIxAEi070915 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sat, 15 Feb 2014 18:59:12 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Subject: Re: svn commit: r261916 - head/sys/dev/xen/console From: David Chisnall In-Reply-To: <20140216035823.I2978@besplex.bde.org> Date: Sat, 15 Feb 2014 18:59:05 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <8C22DE47-60F2-47C0-938D-590324818872@FreeBSD.org> References: <201402151237.s1FCbRnh000507@svn.freebsd.org> <20140216035823.I2978@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1827) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Dimitry Andric X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 15 Feb 2014 18:59:22 -0000 On 15 Feb 2014, at 17:02, Bruce Evans wrote: > Why? There are hundreds if not thousands of static inline functions = in > headers, and most of these functions are not always used, so there = would > be [hundreds if not thousands] * [number of #includes] compiler = warnings > if compilers warned about things like this. They could handle include > files specially, but shouldn't. They do, and absolutely should, handle include files separately. If you = have a static inline function in a header that is not used in a specific = compilation unit, then that is a little bit of extra work for the = compiler as it has to parse it without it being used, but it is not a = problem. It is a safe assumption that it is used by at least one = compilation unit and so is not dead code (and even if it isn't yet, it = is part of an API, and so removing it would be an error). In contrast, a static inline function in the main source file for a = compilation unit is definitely a bug. It is obviously dead code. It is = likely that it either should have been removed when all callers were = deleted, or should not have been static but accidentally was. =20 David