Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Oct 1995 20:24:54 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        matt@lkg.dec.com, terry@lambert.org, hackers@freefall.freebsd.org, julian@freefall.freebsd.org
Subject:   Re: suggested changes to mbuf routines
Message-ID:  <199510170324.UAA26514@phaeton.artisoft.com>
In-Reply-To: <199510170312.NAA21632@godzilla.zeta.org.au> from "Bruce Evans" at Oct 17, 95 01:12:33 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> The caddr_t's are bogus because free() takes a `void *' arg even in the
> kernel.  The u_long is fairly bogus, but malloc() takes a u_long arg
> instead of a size_t arg too.
> 
> We have been removing bogus casts to (caddr_t) for `void *' function args.
> Perhaps that has gone a bit far.  There is no problem in ANSI C, but in
> K&R C the following change is incorrect:
> 
> 	void func __P((void *));
> 	int *foo;
> from:
> 	func((caddr_t)foo);	/* works because addr_t has same
> 				 * representation as void *, but bogus */
> to:
> 	func(foo);		/* works in ANSI C; fails in K&R C if
> 				 * void * has a different representation
> 				 * to int * */
> "right":
> 	func((void *)foo);	/* "always" works; actually it only works
> 				 * if the K&R compiler is not krufty enough
> 				 * to be missing void *, and not braindamaged
> 				 * enough to use different representations
> 				 * for void * and caddr_t */


The more you code, the more there is that needs coded.  8-(.

Man... we need to get *done* on some of these things.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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