From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32636 invoked by alias); 11 Jun 2003 23:47:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32625 invoked from network); 11 Jun 2003 23:47:33 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 11 Jun 2003 23:47:33 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h5BNlXH21035 for ; Wed, 11 Jun 2003 19:47:33 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5BNlWI26814; Wed, 11 Jun 2003 19:47:32 -0400 Received: from localhost.localdomain (vpn50-31.rdu.redhat.com [172.16.50.31]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h5BNlVe26024; Wed, 11 Jun 2003 19:47:31 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h5BNlPI27465; Wed, 11 Jun 2003 16:47:25 -0700 Date: Wed, 11 Jun 2003 23:47:00 -0000 From: Kevin Buettner Message-Id: <1030611234725.ZM27464@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [patch rfc] -Wmissing-prototypes round #3" (Jun 11, 3:24pm) References: <3EE76A05.2050409@redhat.com> <86ptlk8mu3.fsf@elgar.kettenis.dyndns.org> <3EE781E1.2010209@redhat.com> To: Andrew Cagney , Mark Kettenis Subject: Re: [patch rfc] -Wmissing-prototypes round #3 Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-06/txt/msg00401.txt.bz2 On Jun 11, 3:24pm, Andrew Cagney wrote: > > Andrew Cagney writes: > > > > > >> - move function declarations to CPU-tdep.h, from config/CPU/tm-CPU.h > >> Ex, m68k's delta68 functions previously in tm-delta.h. > >> This ensures that the function declaration is always visible, and that a > >> global function in CPU-tdep.c has its declaration in the corresponding > >> CPU-tdep.h file. The config/CPU/tm-CPU.h files were also updated to > >> include the corresponding "CPU-tdep.h". > > > > > > I'm not sure whether this part of your patch is a good idea. Quite a > > number of function declarations in config/CPU/tm-CPU.h are for things > > that haven't been multi-arched yet. Keeping the function declaration > > next to the #define that uses them, makes it easier to remove them > > once they're no longer needed. > > I thought someone might comment, that's why I tried to make what was > happening very clear :-) > > It's a real trade off. > > -- delay -Wmissing-prototypes until multi-arch is finished > > -- move the declarations so that they are always visible > > -- drop -Werror for certain architectures > > Given the problems that -Wmissing-prototypes has thrown up (extern in > .c, forgetting to include .h), I'd prefer to see it enabled. > > Also note the number of *-tdep.c functions I make static. It's pretty > clear that people deleting the #define/declaration consistently forget > to update the corresponding function definition. > > I think a better way of handling these stray global declarations would > be to use some sort of real code analysis tool (which the ari isn't :-). I happen to agree with Mark on this, but I'm also sympathetic to Andrew's desire to get -Wmissing-prototypes going. As a compromise, I suggest moving the function declarations as Andrew proposes, but also putting a pointer (comment) to the (new) location of the declaration along with a reminder to remove it and make it static when the function is question is finally multiarched. Kevin