Deutsch English Français Italiano |
<v6gab6$qdd2$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Mon, 8 Jul 2024 11:08:53 +0200 Organization: A noiseless patient Spider Lines: 26 Message-ID: <v6gab6$qdd2$1@dont-email.me> References: <v6bavg$3pu5i$1@dont-email.me> <20240706054641.175@kylheku.com> <v6bfi1$3qn4u$1@dont-email.me> <l9ciO.7$cr5e.2@fx05.iad> <877cdyuq0f.fsf@bsb.me.uk> <2ckiO.19403$7Ej.4487@fx46.iad> <87plrpt4du.fsf@bsb.me.uk> <9bCiO.7108$sXW9.3805@fx41.iad> <87jzhwu5v9.fsf@bsb.me.uk> <20240708001722.280@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 08 Jul 2024 11:08:54 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2e51e5fd70cdbe4c1f963f7eccd0f3b4"; logging-data="865698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qfufuwaf0ZZ6JpsZyNXA3" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:KfB3a8JKXCQTMTt/64afU9JPkUg= X-Enigmail-Draft-Status: N1110 In-Reply-To: <20240708001722.280@kylheku.com> Bytes: 2442 On 08.07.2024 09:19, Kaz Kylheku wrote: > On 2024-07-07, Ben Bacarisse <ben@bsb.me.uk> wrote: >> I find myself completely out of step with many posters here about >> "explicit code" should look like. I think >> >> char *p = 0; >> >> is explicit enough and, in fact, I consider it a plus point if someone >> reading it goes "hey, what's going on here?" and ends up learning that 0 >> is null pointer constant in C. > > And if that person is on the C or C++ langauge committee, that bit of > learning could just prevent a superfluous non-invention like nullptr. What's superfluous to one is useful for others (e.g. for grep'ing occurrences of a null-pointer value in source codes); if it's not defined in a standard it gets explicitly defined individually, and then likely in different (non-uniform, non-standard) ways. To me it's more likely that because of that it had been deliberately added to support such desires, and less likely that the C-standards folks need to learn "C" and wouldn't know what 0 as a pointer value would mean or that it has a clear semantic in such pointer contexts. Janis