This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] rm unused symtab & sh functions; Was: [obish] -Wunused-functionwarnings


Andrew Cagney writes:
> Hello,
> > Attached is a list of all the -Wunused-function warnings that I'm > seeing. Since all these functions are unreachable (i.e., dead code), I > think their removal is pretty obvious.


> src/gdb/dwarf2read.c:615: warning: `dwarf2_unsupported_at_frame_base_complaint' defined but not used

yes

> src/gdb/sh64-tdep.c:835: warning: `sh64_get_gdb_regnum' defined but not used

yes

> src/gdb/stabsread.c:199: warning: `lrs_general_complaint' defined but not used

yes, leftover from live range splitting cleanup.

> src/gdb/stabsread.c:540: warning: `ref_search_value' defined but not used

ditto

> src/gdb/stabsread.c:92: warning: `get_substring' declared `static' but never defined

leftover from cfront cleanup function was deleted but proto is still there.

> src/gdb/symfile.c:208: warning: `compare_symbols' defined but not used

leftover from David's cleanups.

So all ok.

Ya! I've committed the attached.


Andrew


2004-01-16  Andrew Cagney  <cagney@redhat.com>

	* symfile.c: Update copyright year.
	(compare_symbols): Delete unused function.
	* stabsread.c: Update copyright year.
	(lrs_general_complaint): Delete unused function.
	(ref_search_value): Ditto.
	(get_substring): Delete declaration.
	* sh64-tdep.c: Update copyright year.
	(sh64_get_gdb_regnum): Delete unused function.
	* dwarf2read.c (dwarf2_unsupported_at_frame_base_complaint):
	Delete unused function.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.120
diff -u -r1.120 dwarf2read.c
--- dwarf2read.c	14 Jan 2004 16:54:41 -0000	1.120
+++ dwarf2read.c	17 Jan 2004 01:03:23 -0000
@@ -612,13 +612,6 @@
 }
 
 static void
-dwarf2_unsupported_at_frame_base_complaint (const char *arg1)
-{
-  complaint (&symfile_complaints,
-	     "unsupported DW_AT_frame_base for function '%s'", arg1);
-}
-
-static void
 dwarf2_const_value_length_mismatch_complaint (const char *arg1, int arg2,
 					      int arg3)
 {
Index: sh64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh64-tdep.c,v
retrieving revision 1.16
diff -u -r1.16 sh64-tdep.c
--- sh64-tdep.c	13 Jan 2004 21:38:47 -0000	1.16
+++ sh64-tdep.c	17 Jan 2004 01:03:23 -0000
@@ -1,6 +1,7 @@
 /* Target-dependent code for Renesas Super-H, for GDB.
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+   2002, 2003, 2004 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -828,12 +829,6 @@
 is_media_pseudo (int rn)
 {
   return (rn >= DR0_REGNUM && rn <= FV_LAST_REGNUM);
-}
-
-static int
-sh64_get_gdb_regnum (int gcc_regnum, CORE_ADDR pc)
-{
-  return translate_insn_rn (gcc_regnum, pc_is_isa32 (pc));
 }
 
 static int
Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.70
diff -u -r1.70 stabsread.c
--- stabsread.c	5 Jan 2004 19:53:07 -0000	1.70
+++ stabsread.c	17 Jan 2004 01:03:23 -0000
@@ -1,7 +1,8 @@
 /* Support routines for decoding "stabs" debugging information format.
-   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
-   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+
+   Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+   Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -89,8 +90,6 @@
 read_one_struct_field (struct field_info *, char **, char *,
 		       struct type *, struct objfile *);
 
-static char *get_substring (char **, int);
-
 static struct type *dbx_alloc_type (int[2], struct objfile *);
 
 static long read_huge_number (char **, int, int *);
@@ -194,12 +193,6 @@
   complaint (&symfile_complaints, "%s", arg1);
 }
 
-static void
-lrs_general_complaint (const char *arg1)
-{
-  complaint (&symfile_complaints, "%s", arg1);
-}
-
 /* Make a list of forward references which haven't been defined.  */
 
 static struct type **undef_types;
@@ -531,16 +524,6 @@
   if (refnum < 0 || refnum > ref_count)
     return 0;
   return ref_map[refnum].sym;
-}
-
-/* Return value for the reference REFNUM.  */
-
-static CORE_ADDR
-ref_search_value (int refnum)
-{
-  if (refnum < 0 || refnum > ref_count)
-    return 0;
-  return ref_map[refnum].value;
 }
 
 /* Parse a reference id in STRING and return the resulting
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.114
diff -u -r1.114 symfile.c
--- symfile.c	23 Nov 2003 19:24:05 -0000	1.114
+++ symfile.c	17 Jan 2004 01:03:23 -0000
@@ -1,7 +1,7 @@
 /* Generic symbol file reading for the GNU debugger, GDB.
 
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
@@ -198,20 +198,6 @@
 
 int auto_solib_limit;
 
-
-/* Since this function is called from within qsort, in an ANSI environment
-   it must conform to the prototype for qsort, which specifies that the
-   comparison function takes two "void *" pointers. */
-
-static int
-compare_symbols (const void *s1p, const void *s2p)
-{
-  struct symbol **s1, **s2;
-
-  s1 = (struct symbol **) s1p;
-  s2 = (struct symbol **) s2p;
-  return (strcmp (SYMBOL_NATURAL_NAME (*s1), SYMBOL_NATURAL_NAME (*s2)));
-}
 
 /* This compares two partial symbols by names, using strcmp_iw_ordered
    for the comparison.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]