From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12970 invoked by alias); 12 Jun 2003 18:08:26 -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 12936 invoked from network); 12 Jun 2003 18:08:24 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 12 Jun 2003 18:08:24 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0E01B2B63; Thu, 12 Jun 2003 14:08:17 -0400 (EDT) Message-ID: <3EE8C191.1060902@redhat.com> Date: Thu, 12 Jun 2003 18:08: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: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch rfc] -Wmissing-prototypes round #3 References: <3EE76A05.2050409@redhat.com> Content-Type: multipart/mixed; boundary="------------030005060102030401020102" X-SW-Source: 2003-06/txt/msg00425.txt.bz2 This is a multi-part message in MIME format. --------------030005060102030401020102 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 872 I've checked in the attached having removed anything someone didn't like :-) > 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 :-). So ... Andrew --------------030005060102030401020102 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 5805 2003-06-12 Andrew Cagney * wince.c: Include "mips-tdep.h". * mips-tdep.h (mips_next_pc): Declare. * mcore-tdep.c: Make more local functions static. * Makefile.in (wince.o): Update dependencies. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.401 diff -u -r1.401 Makefile.in --- Makefile.in 12 Jun 2003 15:44:22 -0000 1.401 +++ Makefile.in 12 Jun 2003 17:57:31 -0000 @@ -2371,9 +2371,8 @@ $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) wince-stub.o: wince-stub.c $(wince_stub_h) wince.o: wince.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) $(gdbcore_h) \ - $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) \ - $(gdb_string_h) $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) \ - $(regcache_h) + $(command_h) $(buildsym_h) $(symfile_h) $(objfiles_h) $(gdb_string_h) \ + $(gdbthread_h) $(gdbcmd_h) $(wince_stub_h) $(regcache_h) $(mips_tdep_h) wrapper.o: wrapper.c $(defs_h) $(value_h) $(wrapper_h) x86-64-linux-nat.o: x86-64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ $(regcache_h) $(gdb_assert_h) $(gdb_string_h) $(gregset_h) \ Index: mcore-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/mcore-tdep.c,v retrieving revision 1.67 diff -u -r1.67 mcore-tdep.c --- mcore-tdep.c 11 Jun 2003 13:16:27 -0000 1.67 +++ mcore-tdep.c 12 Jun 2003 17:57:33 -0000 @@ -202,7 +202,7 @@ instructions are 16 bits, this is all we need, regardless of address. bpkt = 0x0000 */ -const unsigned char * +static const unsigned char * mcore_breakpoint_from_pc (CORE_ADDR * bp_addr, int *bp_size) { static char breakpoint[] = @@ -606,7 +606,7 @@ then DEPRECATED_INIT_EXTRA_FRAME_INFO and DEPRECATED_INIT_FRAME_PC will be called for the new frame. */ -CORE_ADDR +static CORE_ADDR mcore_frame_chain (struct frame_info * fi) { struct frame_info *dummy; @@ -664,7 +664,7 @@ /* Skip the prologue of the function at PC. */ -CORE_ADDR +static CORE_ADDR mcore_skip_prologue (CORE_ADDR pc) { CORE_ADDR func_addr, func_end; @@ -684,13 +684,13 @@ } /* Return the address at which function arguments are offset. */ -CORE_ADDR +static CORE_ADDR mcore_frame_args_address (struct frame_info * fi) { return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; } -CORE_ADDR +static CORE_ADDR mcore_frame_locals_address (struct frame_info * fi) { return get_frame_base (fi) - get_frame_extra_info (fi)->framesize; @@ -716,7 +716,7 @@ /* Find the value of register REGNUM in frame FI. */ -CORE_ADDR +static CORE_ADDR mcore_find_callers_reg (struct frame_info *fi, int regnum) { for (; fi != NULL; fi = get_next_frame (fi)) @@ -735,7 +735,7 @@ /* Find the saved pc in frame FI. */ -CORE_ADDR +static CORE_ADDR mcore_frame_saved_pc (struct frame_info * fi) { @@ -802,7 +802,7 @@ FIRST_ARGREG, since the MCORE treats struct returns (of less than eight bytes) as hidden first arguments. */ -CORE_ADDR +static CORE_ADDR mcore_push_arguments (int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { @@ -912,7 +912,7 @@ opted to use generic call dummies, so we simply store the CALL_DUMMY_ADDRESS into the PR register (r15). */ -CORE_ADDR +static CORE_ADDR mcore_push_return_address (CORE_ADDR pc, CORE_ADDR sp) { write_register (PR_REGNUM, CALL_DUMMY_ADDRESS ()); @@ -938,7 +938,7 @@ EXTRACT_RETURN_VALUE? GCC_P is true if compiled with gcc and TYPE is the type (which is known to be struct, union or array). */ -int +static int mcore_use_struct_convention (int gcc_p, struct type *type) { return (TYPE_LENGTH (type) > 8); @@ -948,7 +948,7 @@ this buffer was passed as a hidden first argument, so just return that address. */ -CORE_ADDR +static CORE_ADDR mcore_extract_struct_value_address (char *regbuf) { return extract_unsigned_integer (regbuf + REGISTER_BYTE (FIRST_ARGREG), DEPRECATED_REGISTER_SIZE); @@ -958,7 +958,7 @@ the function's return value and place the result into VALBUF. REGBUF is the register contents of the target. */ -void +static void mcore_extract_return_value (struct type *type, char *regbuf, char *valbuf) { /* Copy the return value (starting) in RETVAL_REGNUM to VALBUF. */ @@ -978,7 +978,7 @@ significant word) and r3 (least significant word, left justified). Note that this includes structures of less than eight bytes, too. */ -void +static void mcore_store_return_value (struct type *type, char *valbuf) { int value_size; @@ -1004,7 +1004,7 @@ This includes allocating space for saved registers and analyzing the prologue of this frame. */ -void +static void mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi) { if (fi && get_next_frame (fi)) Index: mips-tdep.h =================================================================== RCS file: /cvs/src/src/gdb/mips-tdep.h,v retrieving revision 1.2 diff -u -r1.2 mips-tdep.h --- mips-tdep.h 12 Apr 2003 17:41:25 -0000 1.2 +++ mips-tdep.h 12 Jun 2003 17:57:33 -0000 @@ -40,4 +40,7 @@ /* Return the MIPS ABI associated with GDBARCH. */ enum mips_abi mips_abi (struct gdbarch *gdbarch); +/* For wince :-(. */ +extern CORE_ADDR mips_next_pc (CORE_ADDR pc); + #endif /* MIPS_TDEP_H */ Index: wince.c =================================================================== RCS file: /cvs/src/src/gdb/wince.c,v retrieving revision 1.22 diff -u -r1.22 wince.c --- wince.c 12 Nov 2002 21:43:55 -0000 1.22 +++ wince.c 12 Jun 2003 17:57:34 -0000 @@ -56,6 +56,9 @@ #include "wince-stub.h" #include #include "regcache.h" +#ifdef MIPS +#include "mips-tdep.h" +#endif /* The ui's event loop. */ extern int (*ui_loop_hook) (int signo); --------------030005060102030401020102--