Date: Thu, 3 Oct 1996 18:16:22 +1000 From: Bruce Evans <bde@zeta.org.au> To: peter@spinner.dialix.com, sos@FreeBSD.org Cc: cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org, jkh@freefall.freebsd.org Subject: Re: cvs commit: src/sys/i386/isa syscons.c Message-ID: <199610030816.SAA06864@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610030816.SAA06864>
