Re: question about nullptr

Liste des GroupesRevenir à cl c 
Sujet : Re: question about nullptr
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.c
Date : 11. Jul 2024, 00:25:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87cynkommh.fsf@bsb.me.uk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Gnus/5.13 (Gnus v5.13)
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

On 09.07.2024 00:55, Ben Bacarisse wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
 
On 08.07.2024 18:23, Ben Bacarisse wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
On 08.07.2024 12:18, Ben Bacarisse wrote:
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
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?
>
Bug-tracking.
>
Can you say more?
>
Frankly, no. [...]
 
OK.
>
So the text you snipped from my reply did not trigger any insight?

I didn't read it.  You said you could not say more so I assumed what
you'd written was not saying more but something else like repeating what
you'd already said.

Another, last try...
Compare it to 'enum' constants. When I code or debug I want to track
(search and find) them by name not by integer number.
Similar with the 'enum' bool type we introduced (when there was not
yet a bool type existing in C or C++) with literal constants 'true'
and 'false'. (Only two values, but still as important.)
Similar with the dedicated pointer value 0 (these days we used the
literal 'null'). (Only one value, still useful for tracking eq/ne
comparisons and initializations.)

Yes, you've said that before.  You want to search for nullptr.  I can't
think of how that might help find a real bug, if that's what you mean by
bug-tracking.

I was hoping for a story... "Once I had this bug where... and if I'd
been using nullptr I'd have found it a day earlier" kind of thing.  I'd
found a lot of bugs over the years, but I don't recall any that would
have been easier to find had I been able to search for nullptr.

I was looking for real-world insight here.  Obviously one could make up
a bug where p = nullptr; was written where, say, p = null - ptr; was
intended, but that's not what I mean.

Without such an example, your argument seems to be overly generic.
Would you welcome the introduction of the keyword unity -- with the
value 1 and type int -- into C because one could then search for it?

--
Ben.

Date Sujet#  Auteur
6 Jul 24 * question about nullptr145Thiago Adams
6 Jul 24 +- Re: question about nullptr1Bonita Montero
6 Jul 24 +- Re: question about nullptr1John McCue
6 Jul 24 +* Re: question about nullptr114Kaz Kylheku
6 Jul 24 i+- Re: question about nullptr96Janis Papanagnou
6 Jul 24 i+* Re: question about nullptr4bart
7 Jul 24 ii`* Re: question about nullptr3Lawrence D'Oliveiro
7 Jul 24 ii +- Re: question about nullptr1Keith Thompson
7 Jul 24 ii `- Re: question about nullptr1bart
12 Jul 24 i`* Re: question about nullptr13Richard Harnden
12 Jul 24 i +* Re: question about nullptr4Kaz Kylheku
13 Jul 24 i i`* Re: question about nullptr3Kaz Kylheku
13 Jul 24 i i +- Re: question about nullptr1James Kuyper
13 Jul 24 i i `- Re: question about nullptr1Keith Thompson
14 Jul 24 i +- Re: question about nullptr1Tim Rentsch
15 Jul 24 i `* Re: question about nullptr7Lawrence D'Oliveiro
16 Jul 24 i  +- Re: question about nullptr1Keith Thompson
16 Jul 24 i  `* Re: question about nullptr5James Kuyper
16 Jul 24 i   +- Re: question about nullptr1Keith Thompson
25 Aug 24 i   `* Re: question about nullptr3dave thompson 2
25 Aug 24 i    +- Re: question about nullptr1Richard Damon
26 Aug 24 i    `- Re: question about nullptr1James Kuyper
6 Jul 24 `* Re: question about nullptr28Richard Damon
6 Jul 24  `* Re: question about nullptr27David Brown
7 Jul 24   +* Re: question about nullptr2Lawrence D'Oliveiro
7 Jul 24   i`- Re: question about nullptr1David Brown
7 Jul 24   +- Re: question about nullptr1Thiago Adams
9 Jul 24   `* Re: question about nullptr23Richard Harnden
9 Jul 24    `* Re: question about nullptr22Chris M. Thomasson
9 Jul 24     `* Re: question about nullptr10Chris M. Thomasson
9 Jul 24      `* Re: question about nullptr9Ben Bacarisse
9 Jul 24       `* Re: question about nullptr8Chris M. Thomasson
9 Jul 24        `* Re: question about nullptr7Chris M. Thomasson
10 Jul 24         +- Re: question about nullptr1Ben Bacarisse
10 Jul 24         `* Re: question about nullptr5James Kuyper
25 Aug 24          `* Re: question about nullptr4dave thompson 2
26 Aug 24           `* Re: question about nullptr3James Kuyper
26 Aug 24            `* Re: question about nullptr2Keith Thompson
26 Aug 24             `- Re: question about nullptr1James Kuyper

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal