From owner-freebsd-stable Tue Oct 16 3:27:38 2001 Delivered-To: freebsd-stable@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id 9F74137B40C for ; Tue, 16 Oct 2001 03:27:33 -0700 (PDT) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Tue, 16 Oct 2001 11:27:10 +0100 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 15tRQD-0007jl-00; Tue, 16 Oct 2001 11:26:05 +0100 Date: Tue, 16 Oct 2001 11:26:04 +0100 (BST) From: Jan Grant X-X-Sender: To: Zero Sum Cc: cjclark , "Crist J. Clark" , Heath Nielson , Warner Losh , David Marker , freebsd-stable Subject: Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] In-Reply-To: <200110161002.f9GA2CA08544@shalimar.net.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 16 Oct 2001, Zero Sum wrote: > On Tuesday 16 October 2001 18:38, Crist J. Clark wrote: > > > > > > > setenv("TEST1", "", 1); > > > setenv("TEST2", NULL, 1); > > > > A huge difference. In the first case, the second argument is a > > pointer aimed at a string which contains the bytes, '\0'. In the > > second case, we have a null pointer. Null pointers point at nothing. > > I had that out with a compiler manufacturer long, long ago. At that > time it was a requirement for a 'correct' C compiler to regard a null > pointer and a pointer to a null string as sematically equivalent. > > Has this changed without me noticing? Was this _ever_ true? Can you supply a pointer please? Considering C's "close to the metal" attitude, I can't see how this could have ever got into the language. jan -- jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/ Tel +44(0)117 9287088 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk Axioms speak louder than words. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message