Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 1997 17:34:19 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, davidn@labs.usn.blaze.net.au
Cc:        hackers@FreeBSD.ORG, j@uriah.heep.sax.de
Subject:   Re: NULL as ((void*)0) (was Re: strlen() question)
Message-ID:  <199702150634.RAA07576@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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;<newline>if (error) ...' caused lots of conflicts
and usually got undone when barf() involves vfs stuff.

Bruce



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