Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Feb 1997 16:56:58 +1100
From:      David Nugent <davidn@labs.usn.blaze.net.au>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        hackers@FreeBSD.ORG, j@uriah.heep.sax.de
Subject:   Re: NULL as ((void*)0) (was Re: strlen() question)
Message-ID:  <19970215165658.18171@usn.blaze.net.au>
In-Reply-To: <199702150432.PAA04488@godzilla.zeta.org.au>; from Bruce Evans on Feb 02, 1997 at 03:32:00PM
References:  <199702150432.PAA04488@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 02, 1997 at 03:32:00PM, Bruce Evans wrote:
> >anyway.  Passing (void *)0 into a vararg list is as invalid as passing
> >0 there if the target type is e.g. char *.
> 
> I think `char *' is required to have the same representation as `void *',
> so this particular pointer mismatch must work.

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.


> If it's in an arg list of a function declared with obsolescent K&R style
> period.  `void foo __P((bar_t *));' is declared with obsolescent K&R
> style if __P(x) expands to ().  There is not much point in using __P()
> if you don't write K&R code (or in using prototypes and depending on
> K&R misfeatures).

__P() is only useful in include files.

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.


Regards,

David Nugent - Unique Computing Pty Ltd - Melbourne, Australia
Voice +61-3-9791-9547  Data/BBS +61-3-9792-3507  3:632/348@fidonet
davidn@freebsd.org davidn@blaze.net.au http://www.blaze.net.au/~davidn/



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