From owner-cvs-all Sat Jan 27 3:32:12 2001 Delivered-To: cvs-all@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id EB40B37B400; Sat, 27 Jan 2001 03:31:48 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id WAA16237; Sat, 27 Jan 2001 22:31:45 +1100 Date: Sat, 27 Jan 2001 22:31:34 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: John Baldwin Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_fork.c src/sys/sys proc.h In-Reply-To: <200101262351.f0QNpf495468@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 26 Jan 2001, John Baldwin wrote: > jhb 2001/01/26 15:51:41 PST > > Modified files: > sys/kern kern_fork.c > sys/sys proc.h > Log: > Fix fork_exit() to take a pointer to a function that returns void as its > first argument rather than a function that returns a void *. > > Noticed by: jake I noticed this too. Function parameters can't be functions in C, so the declaration was confusing, but the same (mis)feature that allows arrays to decay to pointers apparently applies, so fork_exit() was misdeclared to take a pointer to a function that returns void *. This is shown by the lack of type mismatches for the following code: struct t; void wrong_fork_exit(void *(void *, struct t *), void *, struct t *); void wrong_fork_exit(void *(*)(void *, struct t *), void *, struct t *); void fork_exit(void (void *, struct t *), void *, struct t *); void fork_exit(void (*)(void *, struct t *), void *, struct t *); The declaration of the first arg for fork_exit() here looks even more like a syntax error than the corresponding declaration for wrong_fork_exit(). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message