From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5041 invoked by alias); 11 Jun 2003 19:25:22 -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 3221 invoked from network); 11 Jun 2003 19:24:28 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 11 Jun 2003 19:24:28 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id D77C42B63; Wed, 11 Jun 2003 15:24:17 -0400 (EDT) Message-ID: <3EE781E1.2010209@redhat.com> Date: Wed, 11 Jun 2003 19:25:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [patch rfc] -Wmissing-prototypes round #3 References: <3EE76A05.2050409@redhat.com> <86ptlk8mu3.fsf@elgar.kettenis.dyndns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00379.txt.bz2 > 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 :-). enjoy, Andrew