From owner-freebsd-stable Tue Oct 16 5:35:25 2001 Delivered-To: freebsd-stable@freebsd.org Received: from tomts14-srv.bellnexxia.net (tomts14.bellnexxia.net [209.226.175.35]) by hub.freebsd.org (Postfix) with ESMTP id 0107B37B40B for ; Tue, 16 Oct 2001 05:35:22 -0700 (PDT) Received: from xena.gsicomp.on.ca ([65.93.39.114]) by tomts14-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011016123521.NJIY27994.tomts14-srv.bellnexxia.net@xena.gsicomp.on.ca>; Tue, 16 Oct 2001 08:35:21 -0400 Received: from localhost (matt@localhost) by xena.gsicomp.on.ca (8.11.1/8.11.1) with ESMTP id f9GCR6u16702; Tue, 16 Oct 2001 08:27:06 -0400 (EDT) (envelope-from matt@xena.gsicomp.on.ca) Date: Tue, 16 Oct 2001 08:27:06 -0400 (EDT) From: Matthew Emmerton To: Zero Sum Cc: cjclark@alum.mit.edu, "Crist J. Clark" , Heath Nielson , Warner Losh , David Marker , freebsd-stable@FreeBSD.ORG 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. I doubt that this was ever the case. A null string and a null pointer are two different things entirely. Treating them as equal would be wrong. -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message