Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] New qRelocInsn RSP packet, docs and NEWS.
Date: Thu, 27 May 2010 20:39:00 -0000	[thread overview]
Message-ID: <m36329f5e4.fsf@fleche.redhat.com> (raw)
In-Reply-To: <201005272109.22413.pedro@codesourcery.com> (Pedro Alves's	message of "Thu, 27 May 2010 21:09:22 +0100")

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> +char *unpack_varlen_hex (char *buff, ULONGEST *result);

Tom> It seems like this declaration could go in tracepoint.h.

Pedro> This function does live in remote.c, but it's defined further
Pedro> down, close to its siblings.  tracepoint.c is also reusing it
Pedro> since not to long ago (since tracing moved to target_ops).
Pedro> remote.h would make a bit more sense though one could argue it
Pedro> could also live in a shared utils.c-kind of file nowadays.

Oops, sorry about the mistake.  I misread which file the definition is in.

My concern is that duplicate declarations lead to bugs, because they can
insulate a module from changes to an API it uses.  Ideally, I think that
all non-static objects ought to have a single declaration in a single
header file, which is included by all users.

Exactly where something lives is secondary to me.  I do think it is
generally better for generic functions to be somewhere like utils.c.
The only real failure mode to a bad placement is a bit of code
duplication, though, and that isn't as serious a problem, at least not
for "leaf" things like this.

thanks,
Tom


  reply	other threads:[~2010-05-27 20:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 15:30 Pedro Alves
2010-05-24 18:23 ` Eli Zaretskii
2010-05-26 18:28   ` Pedro Alves
2010-05-25 16:55 ` Joel Brobecker
2010-05-27 19:58 ` Tom Tromey
2010-05-27 20:14   ` Pedro Alves
2010-05-27 20:39     ` Tom Tromey [this message]
2010-05-27 21:03       ` Pedro Alves
2010-05-27 20:43     ` Pedro Alves
2010-06-01 19:10       ` 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=m36329f5e4.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --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