From owner-freebsd-current@FreeBSD.ORG Mon Jan 17 22:16:59 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2355B16A4CE; Mon, 17 Jan 2005 22:16:59 +0000 (GMT) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 821F543D41; Mon, 17 Jan 2005 22:16:58 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.13.0/8.13.0) with ESMTP id j0HMGvVG027352; Mon, 17 Jan 2005 17:16:57 -0500 Mime-Version: 1.0 Message-Id: In-Reply-To: <20050117053655.GA96378@dragon.nuxi.com> References: <20050117053655.GA96378@dragon.nuxi.com> Date: Mon, 17 Jan 2005 17:16:56 -0500 To: obrien@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-current@freebsd.org cc: Robert Watson Subject: Re: gratuitous gcc warnings: unused function arguments? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Jan 2005 22:16:59 -0000 At 9:36 PM -0800 1/16/05, David O'Brien wrote: >On Sun, Jan 16, 2005, Garance A Drosihn wrote: > > At 9:05 PM +0000 1/16/05, Robert Watson wrote: >> >On Sun, 16 Jan 2005, David O'Brien wrote: >> > > We're not going to hack GCC to deal with this. That is going way >> > > too far. This is coming up because people are using high WARNS > > > > values in Makefiles. Either back them down to a lower WARNS > > > > value; or we should add -Wno-unused-parameter to WARNS level 3. > > > > > > I'd be fine with simply pushing threshold for unused parameters > > > up a few notches on the warning scale. I'd like to have access > > > to the other interesting warnings are WARNS=3 and WARNS=4 relating > > > to qualifiers, strings, etc. > > >> I think it would be useful to keep that warning "in general", but >> have an option to turn it off. The following seems to work for me, >> assuming we can decide on the best name for a new NO_WUNUSED_ARGS >> option: > >Do you have a piece of code that exhibits this warning but otherwise >could pass at higher warning level? Who? Robert? Or me? I might, but I can't think of any at the moment. However, I have had cases where this warning has pointed out bugs to me -- such as a routine using a global variable because it had misspelled a reference to one of its own parameters. So, "in general" I do think this is a useful warning. And I (personally) prefer using __unused or the '(void)some_arg;' trick to silence the warning. >I'm resistant to adding a lot of NO_FOO_WARNING knobs. Otherwise we >might as well as remove the whole WARNS thing and set each warning a >Makefile wants. If developers would prefer to always turn it off for WARNS=3 and WARNS=4, that is certainly fine with me too. I agree that we do not want a lot of NO_WARN_FOO options, but I can see where this warning might be very annoying for a few (otherwise clean) source files. I wouldn't want those source files to be compiled with WARNS=2 (or to avoid -Werror) for no other reason than to avoid hassles with this one check. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu