This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] New qRelocInsn RSP packet, docs and NEWS.
On Thursday 27 May 2010 21:37:07, Tom Tromey wrote:
> 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.
Oh, you know I agree with that! :-) I didn't remember that tracepoint.c
was using this function, and since I had written this a while ago, I
had forgotten/missed why the declaration I was adding didn't
have a "static" qualifier.
> 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.
Yep, agreed on all accounts; I've written a patch to move the
declaration to a header. I've left moving the functions somewhere
else for another day; it doesn't seem to add much benefit today.
--
Pedro Alves