From owner-cvs-sys Thu Oct 3 01:19:55 1996 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id BAA12329 for cvs-sys-outgoing; Thu, 3 Oct 1996 01:19:55 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id BAA12322; Thu, 3 Oct 1996 01:19:46 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id SAA06864; Thu, 3 Oct 1996 18:16:22 +1000 Date: Thu, 3 Oct 1996 18:16:22 +1000 From: Bruce Evans Message-Id: <199610030816.SAA06864@godzilla.zeta.org.au> To: peter@spinner.dialix.com, sos@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/isa syscons.c Cc: cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org, jkh@freefall.freebsd.org Sender: owner-cvs-sys@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >In theory, it can be written: practice >void >func(x, y) >int x __unused; >char *y __unused; >{ > return (1); >} >... >That should be enough to shut up gcc. Althought what to do about the >SYSCTL macro for declaring functions where you don't get the chance to >do this, I'm not sure about. The macro cases are easier. You just add __unused once to each arg in the macro instead of to thousands of args in scattered functions. This works because the `unused' attribute doesn't mean that the thing that it is attached to is unused - it means that the thing is possibly unused and so the -Wunused warning should be suppressed. I don't want to add non-C to thousands of args in scattered functions. The unused attribute doesn't work right in typedefs. Otherwise we could use /* Args to switch functions are often unused, so don't warn about them. */ typedef int sy_call_t __P((struct proc *p __unused, void *uap __unused, int *retval __unused)); The unused attribute is silently ignored here :-(. Bruce