From owner-freebsd-current@FreeBSD.ORG Mon Mar 1 09:11:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CB8216A4CF for ; Mon, 1 Mar 2004 09:11:13 -0800 (PST) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by mx1.FreeBSD.org (Postfix) with SMTP id F0F0643D1F for ; Mon, 1 Mar 2004 09:11:10 -0800 (PST) (envelope-from ertr1013@student.uu.se) Received: (qmail 61100 invoked by uid 1001); 1 Mar 2004 17:11:09 -0000 Date: Mon, 1 Mar 2004 18:11:09 +0100 From: Erik Trulsson To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20040301171109.GA61055@falcon.midgard.homeip.net> Mail-Followup-To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= , Mark Murray , current@freebsd.org References: <200402291546.i1TFkZ0w070591@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: User-Agent: Mutt/1.5.6i cc: current@freebsd.org cc: Mark Murray Subject: Re: NULL vs 0 vs 0L bikeshed time X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2004 17:11:13 -0000 On Mon, Mar 01, 2004 at 05:42:28PM +0100, Dag-Erling Sm=F8rgrav wrote: > Mark Murray writes: > > I'd like to commit the following patch. It makes sure that for C > > and the kernel, NULL is a ((void *)0) >=20 > This is not correct, because it makes NULL unusable for function > pointers; you can assign 0 to a function pointer, but not (void *)0. If it is valid to assign 0 to a function pointer then it is valid to assign ((void*)0). They are both null pointer constants If the compiler does not allow it then it is a compiler bug IMO. (I am not quite sure if it is actually valid to assign a null pointer constant to a function pointer, but I think it is, and if it is valid then any null pointer constant shall work.) --=20 Erik Trulsson ertr1013@student.uu.se