From owner-freebsd-hackers Fri Feb 14 21:58:25 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA02376 for hackers-outgoing; Fri, 14 Feb 1997 21:58:25 -0800 (PST) Received: from labs.usn.blaze.net.au (labs.usn.blaze.net.au [203.17.53.30]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA02343 for ; Fri, 14 Feb 1997 21:58:04 -0800 (PST) Received: (from davidn@localhost) by labs.usn.blaze.net.au (8.8.5/8.8.5) id QAA22441; Sat, 15 Feb 1997 16:57:00 +1100 (EST) Message-ID: <19970215165658.18171@usn.blaze.net.au> Date: Sat, 15 Feb 1997 16:56:58 +1100 From: David Nugent To: Bruce Evans Cc: hackers@FreeBSD.ORG, j@uriah.heep.sax.de Subject: Re: NULL as ((void*)0) (was Re: strlen() question) References: <199702150432.PAA04488@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.61 In-Reply-To: <199702150432.PAA04488@godzilla.zeta.org.au>; from Bruce Evans on Feb 02, 1997 at 03:32:00PM Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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/