From owner-freebsd-hackers Fri Feb 14 22:36:52 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id WAA04081 for hackers-outgoing; Fri, 14 Feb 1997 22:36:52 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA04073 for ; Fri, 14 Feb 1997 22:36:48 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id RAA07576; Sat, 15 Feb 1997 17:34:19 +1100 Date: Sat, 15 Feb 1997 17:34:19 +1100 From: Bruce Evans Message-Id: <199702150634.RAA07576@godzilla.zeta.org.au> To: bde@zeta.org.au, davidn@labs.usn.blaze.net.au Subject: Re: NULL as ((void*)0) (was Re: strlen() question) Cc: hackers@FreeBSD.ORG, j@uriah.heep.sax.de Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Hmm, I always thought it was "void * must be at least as large as the >largest pointer type" for a given implementation. I must dig out my >copy of the almost-final draft ANSI spec again, but I wasn't aware >that char * should follow this rule too, which is what your statement >implies. I think the sizeof(void *) is unrelated to sizeof(foo_t *) except when foo_t is char. All that is generally required is that casts from a valid (foo_t *) to (void *) and back not lose information. (foo_t *) might be larger if it has unused bits. >__P() is only useful in include files. System include files. I agree, but CSRG didn't. >FWIW, I think compatibility with K&R is a crock anyway these >days. I follow this rule to keep people (hi Bruce ;-)) happy, >and for the sake of consistency. I only insist on K&R compatibility for consistency. BTW, the Lite2 merge would have been much easier if we had followed the style guide for new code and not changed the style of old code just to fix warnings. Changing `if (error = barf()) ...' to `error = barf;if (error) ...' caused lots of conflicts and usually got undone when barf() involves vfs stuff. Bruce