From: Andrew Cagney <ac131313@ges.redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: naive GDB programming style questions
Date: Thu, 12 Sep 2002 11:35:00 -0000 [thread overview]
Message-ID: <3D80DE86.2070407@ges.redhat.com> (raw)
In-Reply-To: <ro1k7lua4cx.fsf@jackfruit.Stanford.EDU>
PS: If you encounter a file that has the old ``dud'' struct style
indentation then running it (otherwize unchanged) through gdb_indent.sh
comes under the ``obvious fix rule''. It lets you get any indentation
issues out of the way up before you start making changes.
Andrew
> 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-12 18:35 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
2002-09-10 11:39 ` David Carlton
2002-09-10 16:15 ` Andrew Cagney
2002-09-12 11:35 ` Andrew Cagney [this message]
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=3D80DE86.2070407@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=carlton@math.stanford.edu \
--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