Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Ben Bacarisse
Newsgroups: comp.lang.c
Subject: Re: question about nullptr
Date: Mon, 08 Jul 2024 11:18:54 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <878qyctcdt.fsf@bsb.me.uk>
References: <20240706054641.175@kylheku.com>
<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
Injection-Date: Mon, 08 Jul 2024 12:18:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f9b9b2152fe0e8376b284d605ac6478c";
logging-data="874710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WWFSgC3Q3doxvBQcF66+7li3Xs4rHqT4="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:ZDZPTgJEMqm2dnZvikOyyUrNJeo=
sha1:Vi82mEVetxUd9h7/PeT4aYrkWsE=
X-BSB-Auth: 1.4726bb15ad40d043147e.20240708111854BST.878qyctcdt.fsf@bsb.me.uk
Bytes: 3140
Janis Papanagnou writes:
> On 08.07.2024 09:19, Kaz Kylheku wrote:
>> On 2024-07-07, Ben Bacarisse 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);
This is been suggested twice now but I'm struggling to see why that is
useful. I can see management wanting one to find all uses of a null
pointer constant to check that they have all been replaced by the
"safer" nullptr, but what's the value in searching for nullptr?
> 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,
That would be a sound suggestion if "such desires" could be explained.
Until then, I suggest it is simply harmonisation with C++. C now has
true and false, [[...]] attributes, typeof, __has_include and no doubt
quite a few more I've forgotten. nullptr is, until some other argument
can be made, just another one of those.
> 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.
--
Ben.