Re: question about nullptr

Liste des GroupesRevenir à l c 
Sujet : Re: question about nullptr
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c
Date : 17. Jul 2024, 18:26:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86h6co56j1.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:

On 11.07.2024 01:25, Ben Bacarisse wrote:
>
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>
[...]
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.)

Neither of these analogies illuminates the question, which is How
is searching for a null pointer value useful.  The enum analogy
suffers both from being much more type specific and from being a
more distinguished value, unlike NULL which applies to all pointer
types, and almost certainly is more broadly used than any of the
named constants defined in an 'enum' type.  The bool analogy is a
more faithful analogy but presents the same question:  how is
searching for a constant like 'true' or 'false' useful?  We might
want to know how a particular variable acquired a particular value
('true', say), but for that question it seems much more fruitful to
search for the variable, or where a particular function is called,
than it does for search for 'true' or 'false'.  Also boolean values
can be the result of a C operator such as '<' or '&&', so searching
for 'true' or 'false' need not turn up the expression being sought.
In fact in the case of booleans I think it is much more likely that
a value being assigned comes from a C operator than it does from a
boolean constant.

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.
>
That's why I had problems to "explain" the reasons to you;  because
it's so universal a property, so obvious (as I said), that I don't
know what else I could say.  (Likewise with "real-word examples".)
What example could I give that explains that if you're looking for
specific dedicated semantical values it's easier to look them up
by [semantical] name than by a [ambiguous] number.  Yes this speeds
up detection of errors when doing code inspections (for bugs or as
QA measure), and yes, this was helpful for program development and
bug detection in [my professional and private] practice.

Ben explains exactly what he is looking for -- a story -- and you
respond by not giving him one.  What's up with that?  Your comment
that something is obvious, followed by an unanswered rhetorical
question, is totally lame.  Ben is asking (I infer) precisely
because such a story or example is not obvious to him.  I can say
for sure that it is not obvious to me.

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?
>
No.  (Please don't start to be ridiculous. - Or did you really miss
the point? - No offense intended.)

I think it is you who is missing the point.  Ben's comment is not a
suggestion but a question.  Moreover as I read the question it is a
sincere effort to gain some insight into what you think and why.
And in response rather than try to answer the question in any helpful
way, instead you ridicule him.  This response does nothing to answer
his question, nor does it give the impression that you are really
listening.  You might want to think about that if you want your
remarks here to be taken seriously.

I want to say something about the nature of newsgroup dialog.
Recently Ben and I had a lengthy exchange where we tried to sort
out our mutual misunderstandings of the other's reading of a
particular passage in the C standard.  It wasn't easy to get to
the key underlying assumptions that prompted our respective
viewpoints.  I know from first-hand experience that Ben is a
smart and thoughtful guy, but despite that we formed radically
different views about something that seemed "obvious" to both
of us.  (I'm not sure how obvious the views were, in either
Ben's case or my own, but I do know it took a lot of explanation
on both sides to get to the point where we understood each
other, which is an indicator that we thought of our own views as
obvious.)  I think the lesson here is that in many cases it is
the most "obvious" thoughts that are most in need of explanation.

Date Sujet#  Auteur
6 Jul 24 * question about nullptr125Thiago Adams
6 Jul 24 +- Re: question about nullptr1Bonita Montero
6 Jul 24 +- Re: question about nullptr1John McCue
6 Jul 24 +* Re: question about nullptr104Kaz Kylheku
6 Jul 24 i+* Re: question about nullptr86Janis Papanagnou
6 Jul 24 ii+* Re: question about nullptr2Janis Papanagnou
6 Jul 24 iii`- Re: question about nullptr1Janis Papanagnou
6 Jul 24 ii+* Re: question about nullptr2Andrey Tarasevich
7 Jul 24 iii`- Re: question about nullptr1Tim Rentsch
6 Jul 24 ii+* Re: question about nullptr2bart
7 Jul 24 iii`- Re: question about nullptr1Keith Thompson
6 Jul 24 ii+* Re: question about nullptr9Chris M. Thomasson
6 Jul 24 iii+* Re: question about nullptr3Chris M. Thomasson
7 Jul 24 iiii`* Re: question about nullptr2Lawrence D'Oliveiro
9 Jul 24 iiii `- Re: question about nullptr1Chris M. Thomasson
6 Jul 24 iii+- Re: question about nullptr1Richard Damon
7 Jul 24 iii+* Re: question about nullptr3James Kuyper
7 Jul 24 iiii`* Re: question about nullptr2Keith Thompson
7 Jul 24 iiii `- Re: question about nullptr1Chris M. Thomasson
7 Jul 24 iii`- Re: question about nullptr1Lawrence D'Oliveiro
7 Jul 24 ii+- Re: question about nullptr1Kaz Kylheku
7 Jul 24 ii`* Re: question about nullptr69Ben Bacarisse
7 Jul 24 ii +- Re: question about nullptr1Tim Rentsch
7 Jul 24 ii +- Re: question about nullptr1Tim Rentsch
7 Jul 24 ii +- Re: question about nullptr1Kaz Kylheku
7 Jul 24 ii `* Re: question about nullptr65Ben Bacarisse
8 Jul 24 ii  +* Re: question about nullptr37Keith Thompson
8 Jul 24 ii  i+- Re: question about nullptr1Janis Papanagnou
8 Jul 24 ii  i+* Re: question about nullptr27Michael S
9 Jul 24 ii  ii+* Re: question about nullptr12Chris M. Thomasson
9 Jul 24 ii  iii`* Re: question about nullptr11Michael S
9 Jul 24 ii  iii `* Re: question about nullptr10Tim Rentsch
9 Jul 24 ii  iii  +* Re: question about nullptr6Thiago Adams
9 Jul 24 ii  iii  i+* Re: question about nullptr3Tim Rentsch
9 Jul 24 ii  iii  ii`* Re: question about nullptr2Thiago Adams
9 Jul 24 ii  iii  ii `- Re: question about nullptr1Tim Rentsch
10 Jul 24 ii  iii  i`* Re: question about nullptr2Kaz Kylheku
10 Jul 24 ii  iii  i `- Re: question about nullptr1Thiago Adams
9 Jul 24 ii  iii  `* Re: question about nullptr3Michael S
9 Jul 24 ii  iii   +- Re: question about nullptr1Tim Rentsch
9 Jul 24 ii  iii   `- Re: question about nullptr1David Brown
9 Jul 24 ii  ii+* Re: question about nullptr4Kaz Kylheku
9 Jul 24 ii  iii`* Re: question about nullptr3Michael S
9 Jul 24 ii  iii +- Re: question about nullptr1Kaz Kylheku
9 Jul 24 ii  iii `- Re: question about nullptr1Tim Rentsch
9 Jul 24 ii  ii`* Re: question about nullptr10Tim Rentsch
9 Jul 24 ii  ii `* Re: question about nullptr9Keith Thompson
9 Jul 24 ii  ii  +- Re: question about nullptr1Chris M. Thomasson
10 Jul 24 ii  ii  `* Re: question about nullptr7Tim Rentsch
10 Jul 24 ii  ii   `* Re: question about nullptr6Keith Thompson
11 Jul 24 ii  ii    +* Re: question about nullptr3James Kuyper
13 Aug 24 ii  ii    i`* Re: question about nullptr2Tim Rentsch
13 Aug 24 ii  ii    i `- Re: question about nullptr1Keith Thompson
13 Aug 24 ii  ii    `* Re: question about nullptr2Tim Rentsch
13 Aug 24 ii  ii     `- Re: question about nullptr1Keith Thompson
8 Jul 24 ii  i+- Re: question about nullptr1Keith Thompson
9 Jul 24 ii  i`* Re: question about nullptr7Andrey Tarasevich
9 Jul 24 ii  i +* Re: question about nullptr2Andrey Tarasevich
11 Jul 24 ii  i i`- Re: question about nullptr1Lawrence D'Oliveiro
9 Jul 24 ii  i `* Re: question about nullptr4Keith Thompson
10 Jul 24 ii  i  `* Re: question about nullptr3Tim Rentsch
10 Jul 24 ii  i   `* Re: question about nullptr2Keith Thompson
12 Aug 24 ii  i    `- Re: question about nullptr1Tim Rentsch
8 Jul 24 ii  `* Re: question about nullptr27Ben Bacarisse
8 Jul 24 ii   +* Re: question about nullptr24Kaz Kylheku
8 Jul 24 ii   i+* Re: question about nullptr22Janis Papanagnou
8 Jul 24 ii   ii+* Re: question about nullptr19Ben Bacarisse
8 Jul 24 ii   iii+* Re: question about nullptr12Janis Papanagnou
8 Jul 24 ii   iiii`* Re: question about nullptr11Ben Bacarisse
8 Jul 24 ii   iiii `* Re: question about nullptr10Janis Papanagnou
9 Jul 24 ii   iiii  `* Re: question about nullptr9Ben Bacarisse
10 Jul 24 ii   iiii   `* Re: question about nullptr8Janis Papanagnou
11 Jul 24 ii   iiii    `* Re: question about nullptr7Ben Bacarisse
12 Jul 24 ii   iiii     `* Re: question about nullptr6Janis Papanagnou
13 Jul 24 ii   iiii      +* Re: question about nullptr3Ben Bacarisse
13 Jul 24 ii   iiii      i`* Re: question about nullptr2Janis Papanagnou
15 Jul 24 ii   iiii      i `- Re: question about nullptr1Ben Bacarisse
13 Jul 24 ii   iiii      +- Re: question about nullptr1Janis Papanagnou
17 Jul 24 ii   iiii      `- Re: question about nullptr1Tim Rentsch
9 Jul 24 ii   iii`* Re: question about nullptr6Kaz Kylheku
9 Jul 24 ii   iii +- Re: question about nullptr1Chris M. Thomasson
9 Jul 24 ii   iii `* Re: question about nullptr4Ben Bacarisse
11 Jul 24 ii   iii  `* Re: question about nullptr3Chris M. Thomasson
11 Jul 24 ii   iii   `* Re: question about nullptr2Ben Bacarisse
11 Jul 24 ii   iii    `- Re: question about nullptr1Chris M. Thomasson
11 Jul 24 ii   ii`* Re: question about nullptr2Lawrence D'Oliveiro
12 Jul 24 ii   ii `- Re: question about nullptr1Janis Papanagnou
8 Jul 24 ii   i`- Re: question about nullptr1Richard Damon
8 Jul 24 ii   `* Re: question about nullptr2James Kuyper
9 Jul 24 ii    `- Re: question about nullptr1Kaz Kylheku
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
16 Jul 24 i `* Re: question about nullptr7Lawrence D'Oliveiro
6 Jul 24 `* Re: question about nullptr18Richard Damon

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal