From owner-svn-src-all@FreeBSD.ORG Thu Feb 16 07:47:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D381065673; Thu, 16 Feb 2012 07:47:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 681478FC0A; Thu, 16 Feb 2012 07:47:15 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q1G7l2Qv011671; Thu, 16 Feb 2012 16:47:12 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q1G7l1xc087259; Thu, 16 Feb 2012 16:47:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Thu, 16 Feb 2012 16:43:32 +0900 (JST) Message-Id: <20120216.164332.2209961872967607025.hrs@allbsd.org> To: eadler@FreeBSD.org From: Hiroki Sato In-Reply-To: <201202160517.q1G5H6Z0000155@svn.freebsd.org> <201202160517.q1G5H14i000118@svn.freebsd.org> References: <201202160517.q1G5H6Z0000155@svn.freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Thu_Feb_16_16_43_32_2012_655)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Thu, 16 Feb 2012 16:47:13 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231817 - head/usr.sbin/IPXrouted X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 16 Feb 2012 07:47:16 -0000 ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in <201202160517.q1G5H6Z0000155@svn.freebsd.org>: ea> Author: eadler ea> Date: Thu Feb 16 05:17:06 2012 ea> New Revision: 231817 ea> URL: http://svn.freebsd.org/changeset/base/231817 ea> ea> Log: ea> Fix warning when compiling with gcc46 ea> ea> Approved by: cperciva ea> MFC after: 3 days ea> ea> Modified: ea> head/usr.sbin/IPXrouted/tables.c (snip) ea> @@ -213,7 +211,6 @@ rtchange(struct rt_entry *rt, struct soc ea> short ticks) ea> { ea> int doioctl = 0, metricchanged = 0; ea> - struct rtuentry oldroute; ea> ea> FIXLEN(gate); ea> /* ea> @@ -281,7 +278,6 @@ rtchange(struct rt_entry *rt, struct soc ea> if (doioctl || metricchanged) { ea> TRACE_ACTION("CHANGE FROM", rt); ea> if (doioctl) { ea> - oldroute = rt->rt_rt; ea> rt->rt_router = *gate; ea> } ea> rt->rt_metric = metric; ea> The oldroute is still used in the #ifdef section at the end of this function. ea> Author: eadler ea> Date: Thu Feb 16 05:17:01 2012 ea> New Revision: 231816 ea> URL: http://svn.freebsd.org/changeset/base/231816 ea> ea> Log: ea> Removed unused code: fixes compiler warning with CC=gcc46 ea> error: parameter 'fd' set but not used ea> ea> Approved by: cperciva ea> MFC after: 1 week ea> ea> Modified: ea> head/usr.bin/gencat/gencat.c ea> ea> Modified: head/usr.bin/gencat/gencat.c ea> ============================================================================== ea> --- head/usr.bin/gencat/gencat.c Thu Feb 16 05:16:55 2012 (r231815) ea> +++ head/usr.bin/gencat/gencat.c Thu Feb 16 05:17:01 2012 (r231816) ea> @@ -462,89 +462,6 @@ MCParse(int fd) ea> } ea> } ea> ea> -void ea> -MCReadCat(int fd) ea> -{ ea> - fd = 0; This file was from NetBSD and this change just increased the diff. I do not understand why the prototype declaration of MCReadCat() was left while the main body was removed. IMHO it is not a good idea to remove unused code partially like this or unused code in one from another project if you just want to suppress a compiler warning. It may suppress the warning, but remaining bits in comments and/or conditional parts where the compiler does not complain make developers confused. I think it is more harmful than the warning. -- Hiroki ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk88s6QACgkQTyzT2CeTzy21+wCfZyyOVOnML3ry8ar7ff+Uuglv Sb8AoJWdi+32rF/XOdo/MaGYxUYyoBZx =ZzuH -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Feb_16_16_43_32_2012_655)----