Path: csiph.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: Is EXIT_SUCCESS/EXIT_FAILURE necessary? Date: Sun, 01 Dec 2024 20:57:05 -0800 Organization: A noiseless patient Spider Lines: 25 Message-ID: <868qsyof6m.fsf@linuxsc.com> References: <8463694f3a751b287c857fca181451f36eeee982.camel@gmail.com> <6OG%O.12794$vGnb.894@fx46.iad> <875xofnhf8.fsf@nosuchdomain.example.com> <87r06zkmh4.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 02 Dec 2024 05:57:06 +0100 (CET) Injection-Info: dont-email.me; posting-host="e9252777fbfdbb5b036d5be7e0226fe4"; logging-data="3265320"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fpXNpdpMPV3vE9E4ZJRPL4x22vBe/4ew=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:O61g4pb7Ezdeix6Juty52z0kMNk= sha1:bv7XVM0Fr/2+F+F5CVipJk356aE= Xref: csiph.com comp.lang.c++:121118 Keith Thompson writes: > David Brown writes: > [...] > >> I don't know if there are any real-world implementations (of C or >> C++) with more than one representation for null pointers, but >> null pointers are somewhat special. "if (x == y)" compares for >> equality of two values, unless one of these is a pointer and the >> other is a null pointer constant - then the comparison is more of >> a classification, checking if the pointer is in the set of null >> pointer values. > > [...] > > I'd say that a null pointer of a given type is a single *value* > that may or may not have multiple *representations*. [...] That's a point of view, but it isn't anything more than that. The abstract value space of pointers is not well defined. By contrast, the abstract value space of an integer data type, such as int, is well defined. Two pointers can compare equal and yet not be the same pointer. There is no reason the same relationship can't hold for null pointers. (In both of the last two sentences the word "pointer" may be read as "pointer value".)