Path: csiph.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: Is EXIT_SUCCESS/EXIT_FAILURE necessary? Date: Mon, 25 Nov 2024 14:03:53 -0800 Organization: None to speak of Lines: 24 Message-ID: <87iksbkm2e.fsf@nosuchdomain.example.com> References: <8463694f3a751b287c857fca181451f36eeee982.camel@gmail.com> <6OG%O.12794$vGnb.894@fx46.iad> <871pz3ngzb.fsf@nosuchdomain.example.com> <5c1e5e41d6fba5e173da099e0f7255838f45ddce.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Mon, 25 Nov 2024 23:03:54 +0100 (CET) Injection-Info: dont-email.me; posting-host="b40b20f4d5912db9f2a914577ca2f33c"; logging-data="3146136"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Ahw18mzrle23d7Oe8QEzO" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:Y34TG491tskumK+lEnVHJSBFY0M= sha1:QobUp5XmvISpgFzglGuWQ00876U= Xref: csiph.com comp.lang.c++:121018 wij writes: [...] > IMO,from programmer's view: > NULL -> a pointer value that the dereference will cause UB. > Whether it is a macro is irrelevant (so the expansion). > nullptr -> C++ wrapper of NULL (whatever the reason) > assert(nullptr==NULL); nullptr exists in C++ (I don't remember when it was introduced) and in C starting with C23. It is, in my opinion, what should have been provided in both languages instead of the NULL macro. > 0 -> I think the language will take special care of it, if it converted > to pointer value. Yes, 0 converted to a pointer type is guaranteed to yield a null pointer value. There are contexts where a pointer expression is required but 0 will not be implicitly converted to the expected type. I'm thinking specifically of arguments to variadic functions, but there may be others. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */