From: Stan Shebs <stan@codesourcery.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] cleanup stale exec.{h|c} xfer_memory comments.
Date: Tue, 23 Jun 2009 19:59:00 -0000 [thread overview]
Message-ID: <4A4133F9.3070208@codesourcery.com> (raw)
In-Reply-To: <m3fxe15p1c.fsf@fleche.redhat.com>
Tom Tromey wrote:
>>>>>> "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.
>
I think that in many cases functions in a header don't get documentation
there because they are intended to be semi-private, and are only in a
header because of the rules of C and our own conventions. For such
functions it would at least be useful to have a line "semi-private,
don't assume you can use this for your own purposes".
Should we maybe introduce a coding rule requiring at least a brief
API/usage comment about each function declaration in a header? Perhaps
all the semi-private functions can be separated into a block with a
comment that applies to the lot of them.
Stan
next prev parent reply other threads:[~2009-06-23 19:59 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
2009-06-16 0:20 ` Joel Brobecker
2009-06-23 19:59 ` Stan Shebs [this message]
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=4A4133F9.3070208@codesourcery.com \
--to=stan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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