From owner-freebsd-current@FreeBSD.ORG Mon Mar 1 22:14:33 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 2C44316A4CE; Mon, 1 Mar 2004 22:14:33 -0800 (PST) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A07843D2D; Mon, 1 Mar 2004 22:14:32 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i226ELnX001874; Tue, 2 Mar 2004 17:14:21 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i226EJsJ027213; Tue, 2 Mar 2004 17:14:20 +1100 Date: Tue, 2 Mar 2004 17:14:18 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Stefan Farfeleder In-Reply-To: <20040301224712.GB959@wombat.fafoe.narf.at> Message-ID: <20040302164649.K8656@gamplex.bde.org> References: <20040301213454.GA959@wombat.fafoe.narf.at> <200403012158.i21LwS0w084961@grimreaper.grondar.org> <20040301224712.GB959@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org 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: Tue, 02 Mar 2004 06:14:33 -0000 On Mon, 1 Mar 2004, Stefan Farfeleder wrote: > On Mon, Mar 01, 2004 at 09:58:28PM +0000, Mark Murray wrote: > > Stefan Farfeleder writes: > > > On Sun, Feb 29, 2004 at 03:46:35PM +0000, Mark Murray wrote: > > > > > > > -#define NULL 0L > > > > +#define NULL (0L) > > > > > > What's the point of parenthesizing 0L? > > > > Its two lexical elements. I got into the habit of doing that when a > > macro replacement bit me some years ago. It is a very unimportant part > > of the patch. :-) > > While I agree that it's quite unimportant, I have to contradict you. > `OL' is a pp-number which is converted to an integer-constant in > translation phase 7 according to the C standard. It always is a single > token. Understanding pp-numbers and transaltion phases is unecessary for this. Quoting small parts of section 6.4: token: ... constant ... constant: integer-constant ... integer-constant: decimal-constant integer-suffix-opt ... So the suffix is part of the token for integer constants. pp-numbers and translation phases, whatever they are, must be consistent with this. For tokens, I think this just means that every C token is a pp-token. Bruce