Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2005 12:49:49 -0800
From:      "David O'Brien" <obrien@FreeBSD.org>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        Robert Watson <rwatson@FreeBSD.org>
Subject:   Re: gratuitous gcc warnings: unused function arguments?
Message-ID:  <20050116204949.GA53539@dragon.nuxi.com>
In-Reply-To: <41EAA3CD.1000903@mac.com>
References:  <Pine.NEB.3.96L.1050116120744.50371A-100000@fledge.watson.org> <41EAA3CD.1000903@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050116204949.GA53539>