From: David Carlton <carlton@math.stanford.edu>
To: Andrew Cagney <ac131313@ges.redhat.com>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: naive GDB programming style questions
Date: Mon, 09 Sep 2002 20:52:00 -0000 [thread overview]
Message-ID: <ro1k7lua4cx.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <3D7D4ED2.2050401@ges.redhat.com>
On Mon, 09 Sep 2002 21:45:54 -0400, Andrew Cagney <ac131313@ges.redhat.com> said:
> I'll assume that you ment ``p_is_null()''.
Right.
> If you've a copy of the ISO C and C++ manuals, have a look at what
> they have to say about ``NULL'' pointers. It's weird.
Really? Hmm. I know that NULL doesn't work as well in C++ as it does
in C, so I've gotten used to using 0 there.
Though if you're referring to the fact that NULL's underlying bit
representation might not be 0, I'm not sure that's a big deal here.
> Anyway, for GDB, ``p == NULL'' is recommended to make it clear that
> the pointer is being tested and not the underlying value.
Okay, then that's what I'll do.
> Just use:
> struct foo
> {
> int mem;
> };
> which is what is output by gdb_indent.sh and emacs.
Excellent.
David
next prev parent reply other threads:[~2002-09-10 3:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 16:14 David Carlton
2002-09-09 18:45 ` Andrew Cagney
2002-09-09 20:52 ` David Carlton [this message]
2002-09-10 11:39 ` David Carlton
2002-09-10 16:15 ` Andrew Cagney
2002-09-12 11:35 ` Andrew Cagney
2002-09-10 8:56 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ro1k7lua4cx.fsf@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=ac131313@ges.redhat.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox