From owner-cvs-all@FreeBSD.ORG Fri Jan 28 10:24:04 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 1928616A4CE; Fri, 28 Jan 2005 10:24:04 +0000 (GMT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA3CC43D1D; Fri, 28 Jan 2005 10:24:03 +0000 (GMT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 65B3E530C; Fri, 28 Jan 2005 11:24:02 +0100 (CET) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 53DCC5308; Fri, 28 Jan 2005 11:23:29 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 2602) id 0F95FB869; Fri, 28 Jan 2005 11:23:29 +0100 (CET) To: Jacques Vidrine References: <200501042007.j04K7Ch1043130@repoman.freebsd.org> <20050104202213.GC63028@elvis.mu.org> <4A4547FB-5F2F-11D9-96EE-000A95BC6FAE@FreeBSD.org> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Fri, 28 Jan 2005 11:23:28 +0100 In-Reply-To: <4A4547FB-5F2F-11D9-96EE-000A95BC6FAE@FreeBSD.org> (Jacques Vidrine's message of "Wed, 5 Jan 2005 09:34:29 -0600") Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on flood.des.no X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL,FORGED_RCVD_HELO autolearn=disabled version=3.0.1 cc: Maxime Henrion cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Xin LI cc: cvs-all@FreeBSD.org 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: Fri, 28 Jan 2005 10:24:04 -0000 Jacques Vidrine writes: > On Jan 4, 2005, at 2:22 PM, Maxime Henrion wrote: > > Xin LI wrote: > > > Modified files: > > > usr.sbin/nologin nologin.c > > > Log: > > > Use __unused macro instead of a bare void for main(). > > 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? > The point was to kill the spurious warnings. Marking arguments as > "unused" accomplishes this, and indicates more clearly to readers of > the code the intentions of the writer. Though "int main(void)" is > acceptable Standard C, the canonical form is preferable, IMHO. Neither is correct; the proper solution (with ample precedent in FreeBSD) is to call getopt() with an empty option string. Furthermore, if __unused is to be used at all, it should be after the argument name, not before its type. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no