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]

[RFA]: Remove unused header files.


The enclosed patch removes some more unused header files from *.c
files.  Unlike the last time, this list was generated from a lint
program that ensures that no macro, typedef, struct, union, enum, or
declaration was used from the header.  This was run on one config, so
there are many files that haven't been processed yet.  First things
first.

In several instances it identified two header files, <errno.h> and
<linespec.h>, as unnecessary because <errno.h> is unconditionally
included in defs.h; and the only declaration in linespec.h
(decode_line_1) is also defined in symtab.h.

I'm unsure about the correct way to handle those are.  As long as
errno.h is included in defs.h, I see no reason to include it in any
*.c file.  One could argue that errno.h should be remove from defs.h,
but since errno (or the E* macros) is used in almost every file, I 
suspect we'd have to #include it in many files.

The decode_line_1() declaration (IMO) indicates a unclear separation
of interface and implementation.  (Again, IMO) a function declaration
should only be in one header.  Please share your thoughts, on this 
specific case, and in general.  decode_line_1() is the first of many
functions that have multiple declarations.

2001-03-01  J.T. Conklin  <jtc@redback.com>

	* arch-utils.c (#include <ctype.h>): Removed.
	* c-typeprint.c: Likewise.
	* dbxread.c: Likewise.
	* gdbtypes.c: Likewise.

	* c-valprint.c (#include "demangle.h"): Removed.
	* ch-typeprint.c: Likewise.
	* eval.c: Likewise.
	* f-typeprint.c: Likewise.
	* f-valprint.c: Likewise.
	* m2-typeprint.c: Likewise.
	* p-typeprint.c: Likewise.

	* m2-typeprint.c (#include "gdb_string.h"): Removed.
	* nlmread.c: Likewise.

	* minsyms.c (#include "gdb-stabs.h"): Removed.
	* mipsread.c: Likewise.
	* nlmread.c: Likewise.

	* m2-typeprint.c (#include "obstack.h"): Removed.
	* m2-valprint.c: Likewise.

	* event-loop.c (#include <setjmp.h>): Removed.

Index: arch-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/arch-utils.c,v
retrieving revision 1.20
diff -c -r1.20 arch-utils.c
*** arch-utils.c	2001/02/08 06:03:52	1.20
--- arch-utils.c	2001/03/02 01:24:58
***************
*** 27,33 ****
  /* Just include everything in sight so that the every old definition
     of macro is visible. */
  #include "gdb_string.h"
- #include <ctype.h>
  #include "symtab.h"
  #include "frame.h"
  #include "inferior.h"
--- 27,32 ----
Index: c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.4
diff -c -r1.4 c-typeprint.c
*** c-typeprint.c	2000/12/15 01:01:46	1.4
--- c-typeprint.c	2001/03/02 01:25:12
***************
*** 37,43 ****
  
  #include "gdb_string.h"
  #include <errno.h>
- #include <ctype.h>
  
  /* Flag indicating target was compiled by HP compiler */
  extern int hp_som_som_object_present;
--- 37,42 ----
Index: c-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-valprint.c,v
retrieving revision 1.6
diff -c -r1.6 c-valprint.c
*** c-valprint.c	2000/11/20 20:33:53	1.6
--- c-valprint.c	2001/03/02 01:25:13
***************
*** 24,30 ****
  #include "gdbtypes.h"
  #include "expression.h"
  #include "value.h"
- #include "demangle.h"
  #include "valprint.h"
  #include "language.h"
  #include "c-lang.h"
--- 24,29 ----
Index: ch-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/ch-typeprint.c,v
retrieving revision 1.2
diff -c -r1.2 ch-typeprint.c
*** ch-typeprint.c	2000/07/30 01:48:24	1.2
--- ch-typeprint.c	2001/03/02 01:25:15
***************
*** 30,36 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "ch-lang.h"
  #include "typeprint.h"
  
--- 30,35 ----
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.13
diff -c -r1.13 dbxread.c
*** dbxread.c	2001/02/25 04:45:11	1.13
--- dbxread.c	2001/03/02 01:25:35
***************
*** 43,49 ****
  
  #include "obstack.h"
  #include "gdb_stat.h"
- #include <ctype.h>
  #include "symtab.h"
  #include "breakpoint.h"
  #include "command.h"
--- 43,48 ----
Index: eval.c
===================================================================
RCS file: /cvs/src/src/gdb/eval.c,v
retrieving revision 1.9
diff -c -r1.9 eval.c
*** eval.c	2000/10/30 15:32:51	1.9
--- eval.c	2001/03/02 01:25:39
***************
*** 27,33 ****
  #include "expression.h"
  #include "target.h"
  #include "frame.h"
- #include "demangle.h"
  #include "language.h"		/* For CAST_IS_CONVERSION */
  #include "f-lang.h"		/* for array bound stuff */
  
--- 27,32 ----
Index: event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.11
diff -c -r1.11 event-loop.c
*** event-loop.c	2001/02/08 06:03:52	1.11
--- event-loop.c	2001/03/02 01:25:41
***************
*** 35,41 ****
  #include <sys/types.h>
  #include "gdb_string.h"
  #include <errno.h>
- #include <setjmp.h>
  #include <sys/time.h>
  
  /* Type of the mask arguments to select. */
--- 35,40 ----
Index: f-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-typeprint.c,v
retrieving revision 1.2
diff -c -r1.2 f-typeprint.c
*** f-typeprint.c	2000/07/30 01:48:25	1.2
--- f-typeprint.c	2001/03/02 01:25:42
***************
*** 32,38 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "f-lang.h"
  #include "typeprint.h"
  #include "frame.h"		/* ??? */
--- 32,37 ----
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.4
diff -c -r1.4 f-valprint.c
*** f-valprint.c	2000/07/30 01:48:25	1.4
--- f-valprint.c	2001/03/02 01:25:43
***************
*** 26,32 ****
  #include "gdbtypes.h"
  #include "expression.h"
  #include "value.h"
- #include "demangle.h"
  #include "valprint.h"
  #include "language.h"
  #include "f-lang.h"
--- 26,31 ----
Index: gdbtypes.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.c,v
retrieving revision 1.16
diff -c -r1.16 gdbtypes.c
*** gdbtypes.c	2000/12/15 01:01:47	1.16
--- gdbtypes.c	2001/03/02 01:25:50
***************
*** 1164,1170 ****
  }
  
  /* New code added to support parsing of Cfront stabs strings */
- #include <ctype.h>
  #define INIT_EXTRA { pextras->len=0; pextras->str[0]='\0'; }
  #define ADD_EXTRA(c) { pextras->str[pextras->len++]=c; }
  
--- 1164,1169 ----
Index: m2-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-typeprint.c,v
retrieving revision 1.2
diff -c -r1.2 m2-typeprint.c
*** m2-typeprint.c	2000/07/30 01:48:26	1.2
--- m2-typeprint.c	2001/03/02 01:25:50
***************
*** 19,25 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "obstack.h"
  #include "bfd.h"		/* Binary File Description */
  #include "symtab.h"
  #include "gdbtypes.h"
--- 19,24 ----
***************
*** 30,39 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "m2-lang.h"
- 
- #include "gdb_string.h"
  #include <errno.h>
  
  void
--- 29,35 ----
Index: m2-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/m2-valprint.c,v
retrieving revision 1.2
diff -c -r1.2 m2-valprint.c
*** m2-valprint.c	2000/07/30 01:48:26	1.2
--- m2-valprint.c	2001/03/02 01:25:50
***************
*** 19,25 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "obstack.h"
  #include "symtab.h"
  #include "gdbtypes.h"
  #include "valprint.h"
--- 19,24 ----
Index: minsyms.c
===================================================================
RCS file: /cvs/src/src/gdb/minsyms.c,v
retrieving revision 1.13
diff -c -r1.13 minsyms.c
*** minsyms.c	2001/02/11 06:11:38	1.13
--- minsyms.c	2001/03/02 01:25:52
***************
*** 46,52 ****
  #include "symfile.h"
  #include "objfiles.h"
  #include "demangle.h"
- #include "gdb-stabs.h"
  
  /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE.
     At the end, copy them all into one newly allocated location on an objfile's
--- 46,51 ----
Index: mipsread.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsread.c,v
retrieving revision 1.6
diff -c -r1.6 mipsread.c
*** mipsread.c	2001/02/10 11:12:06	1.6
--- mipsread.c	2001/03/02 01:25:52
***************
*** 32,38 ****
  #include "objfiles.h"
  #include "buildsym.h"
  #include "stabsread.h"
- #include "gdb-stabs.h"
  
  #include "coff/sym.h"
  #include "coff/internal.h"
--- 32,37 ----
Index: nlmread.c
===================================================================
RCS file: /cvs/src/src/gdb/nlmread.c,v
retrieving revision 1.5
diff -c -r1.5 nlmread.c
*** nlmread.c	2000/12/15 01:01:48	1.5
--- nlmread.c	2001/03/02 01:25:52
***************
*** 20,31 ****
     Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
- #include "gdb_string.h"
  #include "bfd.h"
  #include "symtab.h"
  #include "symfile.h"
  #include "objfiles.h"
- #include "gdb-stabs.h"
  #include "buildsym.h"
  #include "stabsread.h"
  
--- 20,29 ----
Index: p-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/p-typeprint.c,v
retrieving revision 1.3
diff -c -r1.3 p-typeprint.c
*** p-typeprint.c	2000/07/30 01:48:26	1.3
--- p-typeprint.c	2001/03/02 01:25:53
***************
*** 32,38 ****
  #include "command.h"
  #include "gdbcmd.h"
  #include "language.h"
- #include "demangle.h"
  #include "p-lang.h"
  #include "typeprint.h"
  
--- 32,37 ----



-- 
J.T. Conklin
RedBack Networks


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