From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
Pedro Alves <pedro@codesourcery.com>,
gdb-patches@sourceware.org
Subject: Re: [commit] cleanup stale exec.{h|c} xfer_memory comments.
Date: Mon, 15 Jun 2009 18:31:00 -0000 [thread overview]
Message-ID: <m3fxe15p1c.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090613111210.GN25703@adacore.com> (Joel Brobecker's message of "Sat\, 13 Jun 2009 07\:12\:10 -0400")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> Unfortunately, I don't think we really have a hard convention in GDB.
Joel> For C, I also tend to prefer documenting the function next to the
Joel> implementation. It's the only way to be consistent, since some functions
Joel> do not have advance declarations.
FWIW, I prefer to have documentation in the header for a module's
public API, and next to the implementation for the private API.
Consistency doesn't matter as much to me as being able to read a
header file and get a grasp of how I would use a module; the private
comments in the module can then describe the implementation.
There are several examples of this in gdb already. Consider:
macro*.[ch], bcache.[ch], dictionary.[ch], addrmap.[ch].
These are all exemplary code, which I think is not coincidental... it
requires more work to write the code this way, but that forces one to
consciously consider the API.
Tom
next prev parent reply other threads:[~2009-06-15 18:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 18:41 Pedro Alves
2009-06-13 3:47 ` Eli Zaretskii
2009-06-13 11:12 ` Joel Brobecker
2009-06-15 18:31 ` Tom Tromey [this message]
2009-06-16 0:20 ` Joel Brobecker
2009-06-23 19:59 ` Stan Shebs
2009-06-23 20:54 ` Tom Tromey
2009-06-13 11:48 ` Pedro Alves
2009-06-13 12:24 ` Eli Zaretskii
2009-06-13 13:26 ` Pedro Alves
2009-06-13 13:31 ` Eli Zaretskii
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=m3fxe15p1c.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=brobecker@adacore.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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