From owner-freebsd-current@FreeBSD.ORG Sun Jan 16 18:44:14 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 D8A1F16A4CE; Sun, 16 Jan 2005 18:44:14 +0000 (GMT) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 764BB43D1F; Sun, 16 Jan 2005 18:44:14 +0000 (GMT) (envelope-from kientzle@freebsd.org) Received: from freebsd.org (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id j0GIiEOZ042511; Sun, 16 Jan 2005 10:44:14 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <41EAB5FE.30603@freebsd.org> Date: Sun, 16 Jan 2005 10:44:14 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Giorgos Keramidas References: <20050116144113.GB66854@gothmog.gr> In-Reply-To: <20050116144113.GB66854@gothmog.gr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 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 18:44:15 -0000 Robert Watson complained that: > >>At some point in the relatively recent past, we began to generate >>warnings for unused arguments in function definitions. .... >> >>int >>main(int argc, char *argv[]) >>{ >> >> if (argc != 1)ut >> usage(); >> >> dostuff(); >>} Giorgos Keramidas suggested: > > % (void)argv; I first saw this idiom for marking unused arguments over 10 years ago and have used it extensively since then. Very portable; highly recommended. Tim