From owner-freebsd-hackers Mon Oct 16 20:31:23 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id UAA07164 for hackers-outgoing; Mon, 16 Oct 1995 20:31:23 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id UAA07159 ; Mon, 16 Oct 1995 20:31:19 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id UAA26514; Mon, 16 Oct 1995 20:24:54 -0700 From: Terry Lambert Message-Id: <199510170324.UAA26514@phaeton.artisoft.com> Subject: Re: suggested changes to mbuf routines To: bde@zeta.org.au (Bruce Evans) Date: Mon, 16 Oct 1995 20:24:54 -0700 (MST) Cc: matt@lkg.dec.com, terry@lambert.org, hackers@freefall.freebsd.org, julian@freefall.freebsd.org In-Reply-To: <199510170312.NAA21632@godzilla.zeta.org.au> from "Bruce Evans" at Oct 17, 95 01:12:33 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 1174 Sender: owner-hackers@FreeBSD.org Precedence: bulk > 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.