From owner-freebsd-current Thu May 28 08:04:14 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA25703 for freebsd-current-outgoing; Thu, 28 May 1998 08:04:14 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA25690 for ; Thu, 28 May 1998 08:04:05 -0700 (PDT) (envelope-from dag-erli@ifi.uio.no) Received: from gjallarhorn.ifi.uio.no (2602@gjallarhorn.ifi.uio.no [129.240.65.40]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id RAA19783; Thu, 28 May 1998 17:03:39 +0200 (MET DST) Received: (from dag-erli@localhost) by gjallarhorn.ifi.uio.no ; Thu, 28 May 1998 17:03:39 +0200 (MET DST) Mime-Version: 1.0 To: Bruce Evans Cc: eivind@yes.no, rnordier@nordier.com, current@FreeBSD.ORG Subject: Re: Replacing gcc as the system compiler References: <199805280348.NAA09679@godzilla.zeta.org.au> Organization: University of Oslo, Department of Informatics X-url: http://www.stud.ifi.uio.no/~dag-erli/ X-Stop-Spam: http://www.cauce.org From: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) Date: 28 May 1998 17:03:38 +0200 In-Reply-To: Bruce Evans's message of "Thu, 28 May 1998 13:48:06 +1000" Message-ID: Lines: 25 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Bruce Evans writes: > > There is also what looks like a bug in handling of NULL - it doesn't > > allow the use of ((void *)0) as NULL for function pointers. > gcc used to have this bug too. Apparently, the C standard can easily > be read as not allowing conversion from (void *)0 to a function pointer. > The standard doesn't allow conversion from an object pointer to a > function pointer, but (void *)0 is is a null pointer constant and > null pointer constants are special. The C null pointer constant is 0. No cast is needed. Converting 0 to a function pointer might work better than converting ((void *)0). The only situation in which it is advantageous to define NULL as ((void*)0) instead of just (0) is when passing NULL to a vararg function which lacks a prototype; but you shouldn't do that anyway, because it will break on more than just NULL (float->double conversion for instance) With the correct prototypes, it is perfectly legal and semantically correct to write e.g. execl("/bin/sh", "-sh", 0); -- Noone else has a .sig like this one. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message