From owner-cvs-all@FreeBSD.ORG Thu Jan 6 11:57:12 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 871CF16A4CE; Thu, 6 Jan 2005 11:57:12 +0000 (GMT) Received: from mx1.originative.co.uk (freebsd.gotadsl.co.uk [81.6.249.198]) by mx1.FreeBSD.org (Postfix) with ESMTP id E70E243D45; Thu, 6 Jan 2005 11:57:11 +0000 (GMT) (envelope-from paul@mx1.originative.co.uk) Received: from localhost (unknown [127.0.0.1]) by mx1.originative.co.uk (Postfix) with ESMTP id 61AA61556B; Thu, 6 Jan 2005 11:57:21 +0000 (GMT) Received: from mx1.originative.co.uk ([127.0.0.1])port 10024) with ESMTP id 65435-06; Thu, 6 Jan 2005 11:57:06 +0000 (GMT) Received: by mx1.originative.co.uk (Postfix, from userid 1000) id 552EA15575; Thu, 6 Jan 2005 11:57:06 +0000 (GMT) Date: Thu, 6 Jan 2005 11:57:06 +0000 From: Paul Richards To: Nik Clayton Message-ID: <20050106115705.GO16316@myrddin.originative.co.uk> References: <20050104202213.GC63028@elvis.mu.org> <20050106104356.GB52159@clan.nothing-going-on.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050106104356.GB52159@clan.nothing-going-on.org> User-Agent: Mutt/1.5.6i cc: src-committers@freebsd.org cc: Maxime Henrion cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: Xin LI cc: Robert Watson Subject: Re: cvs commit: src/usr.sbin/nologin nologin.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 11:57:12 -0000 On Thu, Jan 06, 2005 at 10:43:56AM +0000, Nik Clayton wrote: > On Tue, Jan 04, 2005 at 11:11:07PM +0000, Robert Watson wrote: > > On Tue, 4 Jan 2005, Maxime Henrion wrote: > > > I bet there is a reason behind this, but I'm totally puzzled at why you > > > would do such a thing. It was much prettier and more "C" before. Could > > > you shed some light on this please? > > > > I ran into exactly the same problem I assume Xin Li is now running into > > just a few days ago: gcc warns if argc and argv are unused in the main() > > definition if they aren't referenced when running at higher WARNS levels. > > I would argue this is a bug in gcc, since main() is part of an API calling > > convention, and it doesn't matter if the arguments are unused by the > > function -- they are still provided by the caller. But then, I'm not a C > > expert, so maybe this opinion is the result of poor breeding? :-) > > What's wrong with (the perfectly legal): > > int > main(void) > { > ... > } > > or does gcc complain about that too? No it doesn't and it seems to me to be more correct than using a gcc macro. -- Paul Richards