From owner-freebsd-current@FreeBSD.ORG Sun Jan 16 20:49:51 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 8CF5B16A4CE; Sun, 16 Jan 2005 20:49:51 +0000 (GMT) Received: from dragon.nuxi.com (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3872143D45; Sun, 16 Jan 2005 20:49:51 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.nuxi.com (obrien@localhost [127.0.0.1]) by dragon.nuxi.com (8.13.1/8.13.1) with ESMTP id j0GKnnlW053683; Sun, 16 Jan 2005 12:49:49 -0800 (PST) (envelope-from obrien@dragon.nuxi.com) Received: (from obrien@localhost) by dragon.nuxi.com (8.13.1/8.13.1/Submit) id j0GKnnTv053682; Sun, 16 Jan 2005 12:49:49 -0800 (PST) (envelope-from obrien) Date: Sun, 16 Jan 2005 12:49:49 -0800 From: "David O'Brien" To: Chuck Swiger Message-ID: <20050116204949.GA53539@dragon.nuxi.com> References: <41EAA3CD.1000903@mac.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41EAA3CD.1000903@mac.com> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 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 Reply-To: obrien@FreeBSD.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2005 20:49:51 -0000 On Sun, Jan 16, 2005 at 12:26:37PM -0500, Chuck Swiger wrote: > >program.c:49: warning: 'main' takes only zero or two arguments > >*** Error code 1 > [ ... ] > >I'm not sure what is required to disable this warning, but I'd like to see > >us make it optional and not keyed to lower warning levels (such as 3). > > Apparently, -Wunused-parameter is now being inferred from the combination > of -W and -Wall. The second error message is only generated when GCC > thinks it is compiling main() (or a moral equivalent thereof), so it > doesn't seem likely that that error would be generated for > dummyfunction(int arg1, int arg2, char *argv). > > However, I'll try to offer a patch which does what you've asked for and let > someone else (hopefully a GCC expert/language pedant :-) second guess > whether the following is a good idea: 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. -- -- David (obrien@FreeBSD.org)