Date: Tue, 16 Oct 2001 11:26:04 +0100 (BST) From: Jan Grant <Jan.Grant@bristol.ac.uk> To: Zero Sum <count@shalimar.net.au> Cc: cjclark <cjclark@alum.mit.edu>, "Crist J. Clark" <cristjc@earthlink.net>, Heath Nielson <heath@cs.byu.edu>, Warner Losh <imp@harmony.village.org>, David Marker <marker_d@yahoo.com>, freebsd-stable <freebsd-stable@FreeBSD.ORG> Subject: Re: setenv() cores with NULL value [was Re: Gdm proplem on 4.4] Message-ID: <Pine.GSO.4.31.0110161124450.2865-100000@mail.ilrt.bris.ac.uk> In-Reply-To: <200110161002.f9GA2CA08544@shalimar.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.31.0110161124450.2865-100000>