From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3825 invoked by alias); 27 May 2010 20:43:51 -0000 Received: (qmail 3814 invoked by uid 22791); 27 May 2010 20:43:50 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 May 2010 20:43:43 +0000 Received: (qmail 25557 invoked from network); 27 May 2010 20:43:41 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 27 May 2010 20:43:41 -0000 From: Pedro Alves To: tromey@redhat.com Subject: Re: [RFA] New qRelocInsn RSP packet, docs and NEWS. Date: Thu, 27 May 2010 21:03:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-21-generic; KDE/4.3.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <201005241435.45703.pedro@codesourcery.com> <201005272109.22413.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005272143.39486.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00663.txt.bz2 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