Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Oct 1996 10:34:22 +0200
From:      Poul-Henning Kamp <phk@critter.tfs.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        peter@spinner.dialix.com, sos@FreeBSD.org, 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:  <5420.844331662@critter.tfs.com>
In-Reply-To: Your message of "Thu, 03 Oct 1996 18:16:22 %2B1000." <199610030816.SAA06864@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help

In message <199610030816.SAA06864@godzilla.zeta.org.au>, Bruce Evans writes:

>I don't want to add non-C to thousands of args in scattered functions.

I agree.

One "semi-clean" way of doing it would have been to add a hack to
gcc so that args named __unused_* wasn't complained about, then you
could:
	int foo (char * _unused_1)
	{
	}
to suppress it.

>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 :-(.

But that's because you cannot say

	sy_call_t
	read 
	{
		if (proc != curproc)
		...
	}

(Which I think is a bug in C btw.)

You don't use the typedef when you declare the function.

That's why I have used the SYSCTL_HANDLER_ARGS solution for sysctl.

We could do the same for syscalls I guess.

--
Poul-Henning Kamp           | phk@FreeBSD.ORG       FreeBSD Core-team.
http://www.freebsd.org/~phk | phk@login.dknet.dk    Private mailbox.
whois: [PHK]                | phk@ref.tfs.com       TRW Financial Systems, Inc.
Future will arrive by its own means, progress not so.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5420.844331662>