Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jan 2001 22:31:34 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern kern_fork.c src/sys/sys proc.h
Message-ID:  <Pine.BSF.4.21.0101272206370.469-100000@besplex.bde.org>
In-Reply-To: <200101262351.f0QNpf495468@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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