From owner-cvs-src@FreeBSD.ORG Wed Jan 5 13:49:55 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8515516A4CE for ; Wed, 5 Jan 2005 13:49:55 +0000 (GMT) Received: from hydra.bec.de (www.ostsee-abc.de [62.206.222.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34FDA43D2F for ; Wed, 5 Jan 2005 13:49:55 +0000 (GMT) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (unknown [139.30.252.67]) by hydra.bec.de (Postfix) with ESMTP id 1DC7735707 for ; Wed, 5 Jan 2005 14:49:54 +0100 (CET) Received: by britannica.bec.de (Postfix, from userid 1001) id 721582AF4; Wed, 5 Jan 2005 14:49:52 +0100 (CET) Date: Wed, 5 Jan 2005 14:49:52 +0100 From: Joerg Sonnenberger To: cvs-src@freebsd.org Message-ID: <20050105134952.GB18921@britannica.bec.de> Mail-Followup-To: cvs-src@freebsd.org References: <20050104202213.GC63028@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Subject: Re: cvs commit: src/usr.sbin/nologin nologin.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2005 13:49:55 -0000 On Tue, Jan 04, 2005 at 11:11:07PM +0000, Robert Watson wrote: > 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? :-) ISO C99, 5.1.2.2.1 allows two prototypes for main: int main(void); int main(int argc, char *argv[]); GCC correctly enforces this. IMO the first is better than using __unused for both parameters, but I'm not a FreeBSD commiter :) Joerg > > Robert N M Watson