[PATCH,gfortran] Clean up unnecessary header files

Steve Kargl sgk@troutmask.apl.washington.edu
Fri Dec 31 18:55:00 GMT 2004


The attached patch removes unneeded header files.  In partricular,
many of the gfortran source files would include standard headers
without the configure HAVE_*_H protection.  Most of these files
are properly handled in "system.h", so we should let "system.h"
do its job.  Additionally, gmp.h is included in gfortran.h and
does not need to be specified in the individual trans*.c files.

bubblestrap and regression tested on i386-*-freebsd6.0


2004-12-31  Steven G. Kargl  <kargls@comcast.net>

        * arith.c: Add system.h; remove string.h
        * decl.c: Ditto
        * matchexp.c: Ditto
        * parse.c: Ditto
        * resolve.c: Ditto
        * st.c: Ditto
        * check.c: Remove stdlib.h and stdarg.h
        * error.c: Remove stdlib.h, stdarg.h, stdio.h, string.h
        * expr.c: Add system.h; remove stdarg.h, stdio.h, and string.h
        * f95-lang.c: Add system.h; remove stdio.h
        * interface.c: Add system.h; remove stdlib.h and string.h
        * intrinsic.c: Remove stdarg.h, stdio.h, and string.h
        * io.c: Remove string.h
        * simplify.c: Ditto
        * match.c: Remove stdarg.h and string.h
        * misc.c: Update copyright; add system.h; remove stdlib.h,
          string.h, and sys/stat.h
        * module.c: Add system.h; remove string.h, stdio.h, errno.h,
          unistd.h, and time.h
        * option.c: Remove string.h and stdlib.h
        * primary.c: Ditto
        * scanner.c: Update copyright; add system.h; remove stdlib.h,
          stdio.h, string.h, and strings.h
        * symbol.c: Add system.h; remove stdlib.h, stdio.h, and string.h
        * trans-array.c: Remove stdio.h and gmp.h
        * trans-const.c: Ditto
        * trans-expr.c: Ditto
        * trans-io.c: Ditto
        * trans-stmt.c: Ditto
        * trans.c: Ditto
        * trans-intrinsic.c: Remove stdio.h and string.h
       
-- 
Steve
-------------- next part --------------
Index: array.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/array.c,v
retrieving revision 1.10
diff -u -b -u -b -B -r1.10 array.c
--- array.c	12 Dec 2004 20:27:00 -0000	1.10
+++ array.c	31 Dec 2004 18:25:15 -0000
@@ -20,11 +20,10 @@
 02111-1307, USA.  */
 
 #include "config.h"
+#include "system.h"
 #include "gfortran.h"
 #include "match.h"
 
-#include <string.h>
-
 /* This parameter is the size of the largest array constructor that we
    will expand to an array constructor without iterators.
    Constructors larger than this will remain in the iterator form.  */
Index: check.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/check.c,v
retrieving revision 1.19
diff -u -b -u -b -B -r1.19 check.c
--- check.c	12 Dec 2004 21:09:09 -0000	1.19
+++ check.c	31 Dec 2004 18:25:17 -0000
@@ -26,10 +26,6 @@
    has been sorted into the right order and has NULL arguments in the
    correct places for missing optional arguments.  */
 
-
-#include <stdlib.h>
-#include <stdarg.h>
-
 #include "config.h"
 #include "system.h"
 #include "flags.h"
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/decl.c,v
retrieving revision 1.27
diff -u -b -u -b -B -r1.27 decl.c
--- decl.c	8 Dec 2004 12:29:44 -0000	1.27
+++ decl.c	31 Dec 2004 18:25:19 -0000
@@ -21,10 +21,10 @@
 
 
 #include "config.h"
+#include "system.h"
 #include "gfortran.h"
 #include "match.h"
 #include "parse.h"
-#include <string.h>
 
 
 /* This flag is set if a an old-style length selector is matched
Index: error.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/error.c,v
retrieving revision 1.8
diff -u -b -u -b -B -r1.8 error.c
--- error.c	16 Sep 2004 16:00:41 -0000	1.8
+++ error.c	31 Dec 2004 18:25:19 -0000
@@ -28,12 +28,6 @@
 
 #include "config.h"
 #include "system.h"
-
-#include <string.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include "flags.h"
 #include "gfortran.h"
 
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/expr.c,v
retrieving revision 1.17
diff -u -b -u -b -B -r1.17 expr.c
--- expr.c	8 Nov 2004 14:56:37 -0000	1.17
+++ expr.c	31 Dec 2004 18:25:21 -0000
@@ -21,10 +21,7 @@
 02111-1307, USA.  */
 
 #include "config.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-
+#include "system.h"
 #include "gfortran.h"
 #include "arith.h"
 #include "match.h"
Index: f95-lang.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/f95-lang.c,v
retrieving revision 1.26
diff -u -b -u -b -B -r1.26 f95-lang.c
--- f95-lang.c	25 Nov 2004 11:13:35 -0000	1.26
+++ f95-lang.c	31 Dec 2004 18:25:22 -0000
@@ -25,6 +25,7 @@
 /* declare required prototypes: */
 
 #include "config.h"
+#include "system.h"
 #include "ansidecl.h"
 #include "system.h"
 #include "coretypes.h"
@@ -49,8 +50,6 @@
 #include "trans-types.h"
 #include "trans-const.h"
 
-#include <stdio.h>
-
 /* Language-dependent contents of an identifier.  */
 
 struct lang_identifier
Index: interface.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/interface.c,v
retrieving revision 1.8
diff -u -b -u -b -B -r1.8 interface.c
--- interface.c	8 Nov 2004 14:56:38 -0000	1.8
+++ interface.c	31 Dec 2004 18:25:23 -0000
@@ -65,9 +65,7 @@
    the program unit name.  */
 
 #include "config.h"
-#include <string.h>
-#include <stdlib.h>
-
+#include "system.h"
 #include "gfortran.h"
 #include "match.h"
 
Index: intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/intrinsic.c,v
retrieving revision 1.34
diff -u -b -u -b -B -r1.34 intrinsic.c
--- intrinsic.c	12 Dec 2004 21:09:09 -0000	1.34
+++ intrinsic.c	31 Dec 2004 18:25:26 -0000
@@ -25,11 +25,6 @@
 #include "config.h"
 #include "system.h"
 #include "flags.h"
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
 #include "gfortran.h"
 #include "intrinsic.h"
 
Index: io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/io.c,v
retrieving revision 1.16
diff -u -b -u -b -B -r1.16 io.c
--- io.c	6 Nov 2004 12:49:13 -0000	1.16
+++ io.c	31 Dec 2004 18:25:28 -0000
@@ -23,9 +23,6 @@
 #include "config.h"
 #include "system.h"
 #include "flags.h"
-
-#include <string.h>
-
 #include "gfortran.h"
 #include "match.h"
 #include "parse.h"
Index: match.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/match.c,v
retrieving revision 1.27
diff -u -b -u -b -B -r1.27 match.c
--- match.c	15 Dec 2004 18:55:53 -0000	1.27
+++ match.c	31 Dec 2004 18:25:30 -0000
@@ -24,10 +24,6 @@
 #include "config.h"
 #include "system.h"
 #include "flags.h"
-
-#include <stdarg.h>
-#include <string.h>
-
 #include "gfortran.h"
 #include "match.h"
 #include "parse.h"
Index: matchexp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/matchexp.c,v
retrieving revision 1.5
diff -u -b -u -b -B -r1.5 matchexp.c
--- matchexp.c	27 May 2004 12:35:12 -0000	1.5
+++ matchexp.c	31 Dec 2004 18:25:30 -0000
@@ -21,7 +21,7 @@
 
 
 #include "config.h"
-#include <string.h>
+#include "system.h"
 #include "gfortran.h"
 #include "arith.h"
 #include "match.h"
Index: misc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/misc.c,v
retrieving revision 1.6
diff -u -b -u -b -B -r1.6 misc.c
--- misc.c	15 Dec 2004 03:56:05 -0000	1.6
+++ misc.c	31 Dec 2004 18:25:31 -0000
@@ -1,5 +1,5 @@
 /* Miscellaneous stuff that doesn't fit anywhere else.
-   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of GCC.
@@ -21,10 +21,7 @@
 
 
 #include "config.h"
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
+#include "system.h"
 #include "gfortran.h"
 
 
Index: module.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/module.c,v
retrieving revision 1.22
diff -u -b -u -b -B -r1.22 module.c
--- module.c	15 Dec 2004 03:56:05 -0000	1.22
+++ module.c	31 Dec 2004 18:25:33 -0000
@@ -64,12 +64,7 @@
    particular order.  */
 
 #include "config.h"
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <unistd.h>
-#include <time.h>
-
+#include "system.h"
 #include "gfortran.h"
 #include "arith.h"
 #include "match.h"
Index: options.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/options.c,v
retrieving revision 1.14
diff -u -b -u -b -B -r1.14 options.c
--- options.c	24 Nov 2004 19:45:27 -0000	1.14
+++ options.c	31 Dec 2004 18:25:33 -0000
@@ -20,8 +20,6 @@
 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 02111-1307, USA.  */
 
-#include <string.h>
-#include <stdlib.h>
 
 #include "config.h"
 #include "system.h"
Index: parse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/parse.c,v
retrieving revision 1.21
diff -u -b -u -b -B -r1.21 parse.c
--- parse.c	8 Nov 2004 14:56:39 -0000	1.21
+++ parse.c	31 Dec 2004 18:25:35 -0000
@@ -22,9 +22,8 @@
 
 
 #include "config.h"
-#include <string.h>
+#include "system.h"
 #include <setjmp.h>
-
 #include "gfortran.h"
 #include "match.h"
 #include "parse.h"
Index: primary.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/primary.c,v
retrieving revision 1.14
diff -u -b -u -b -B -r1.14 primary.c
--- primary.c	8 Nov 2004 14:56:39 -0000	1.14
+++ primary.c	31 Dec 2004 18:25:36 -0000
@@ -23,9 +23,6 @@
 #include "config.h"
 #include "system.h"
 #include "flags.h"
-
-#include <string.h>
-#include <stdlib.h>
 #include "gfortran.h"
 #include "arith.h"
 #include "match.h"
Index: resolve.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/resolve.c,v
retrieving revision 1.24
diff -u -b -u -b -B -r1.24 resolve.c
--- resolve.c	15 Dec 2004 03:56:05 -0000	1.24
+++ resolve.c	31 Dec 2004 18:25:40 -0000
@@ -19,10 +19,12 @@
 Software Foundation, 59 Temple Place - Suite 330,Boston, MA
 02111-1307, USA.  */
 
+
 #include "config.h"
+#include "system.h"
 #include "gfortran.h"
 #include "arith.h"  /* For gfc_compare_expr().  */
-#include <string.h>
+
 
 /* Stack to push the current if we descend into a block during
    resolution.  See resolve_branch() and resolve_code().  */
Index: scanner.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/scanner.c,v
retrieving revision 1.14
diff -u -b -u -b -B -r1.14 scanner.c
--- scanner.c	15 Dec 2004 19:15:40 -0000	1.14
+++ scanner.c	31 Dec 2004 18:25:41 -0000
@@ -1,5 +1,5 @@
 /* Character scanner.
-   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
    Contributed by Andy Vaught
 
 This file is part of GCC.
@@ -42,11 +42,7 @@
    new characters and do a lot of jumping backwards.  */
 
 #include "config.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-
+#include "system.h"
 #include "gfortran.h"
 
 /* Structure for holding module and include file search path.  */
Index: simplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/simplify.c,v
retrieving revision 1.15
diff -u -b -u -b -B -r1.15 simplify.c
--- simplify.c	30 Oct 2004 14:42:22 -0000	1.15
+++ simplify.c	31 Dec 2004 18:25:44 -0000
@@ -23,9 +23,6 @@
 #include "config.h"
 #include "system.h"
 #include "flags.h"
-
-#include <string.h>
-
 #include "gfortran.h"
 #include "arith.h"
 #include "intrinsic.h"
Index: st.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/st.c,v
retrieving revision 1.5
diff -u -b -u -b -B -r1.5 st.c
--- st.c	17 Aug 2004 15:34:09 -0000	1.5
+++ st.c	31 Dec 2004 18:25:44 -0000
@@ -25,8 +25,8 @@
    target.  */
 
 #include "config.h"
+#include "system.h"
 #include "gfortran.h"
-#include <string.h>
 
 gfc_code new_st;
 
Index: symbol.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/symbol.c,v
retrieving revision 1.16
diff -u -b -u -b -B -r1.16 symbol.c
--- symbol.c	8 Sep 2004 14:33:02 -0000	1.16
+++ symbol.c	31 Dec 2004 18:25:46 -0000
@@ -22,10 +22,7 @@
 
 
 #include "config.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
+#include "system.h"
 #include "gfortran.h"
 #include "parse.h"
 
Index: trans-array.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-array.c,v
retrieving revision 1.31
diff -u -b -u -b -B -r1.31 trans-array.c
--- trans-array.c	16 Nov 2004 02:02:37 -0000	1.31
+++ trans-array.c	31 Dec 2004 18:25:50 -0000
@@ -81,12 +81,10 @@
 #include "coretypes.h"
 #include "tree.h"
 #include "tree-gimple.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
 #include "flags.h"
-#include <gmp.h>
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"
Index: trans-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-const.c,v
retrieving revision 1.18
diff -u -b -u -b -B -r1.18 trans-const.c
--- trans-const.c	4 Oct 2004 20:55:49 -0000	1.18
+++ trans-const.c	31 Dec 2004 18:25:50 -0000
@@ -25,11 +25,9 @@
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
-#include <gmp.h>
 #include <math.h>
 #include "gfortran.h"
 #include "trans.h"
Index: trans-expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-expr.c,v
retrieving revision 1.33
diff -u -b -u -b -B -r1.33 trans-expr.c
--- trans-expr.c	27 Dec 2004 16:56:38 -0000	1.33
+++ trans-expr.c	31 Dec 2004 18:25:52 -0000
@@ -27,13 +27,11 @@
 #include "coretypes.h"
 #include "tree.h"
 #include "convert.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
 #include "tree-gimple.h"
 #include "flags.h"
-#include <gmp.h>
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-const.h"
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.36
diff -u -b -u -b -B -r1.36 trans-intrinsic.c
--- trans-intrinsic.c	27 Dec 2004 17:13:05 -0000	1.36
+++ trans-intrinsic.c	31 Dec 2004 18:25:55 -0000
@@ -26,8 +26,6 @@
 #include "system.h"
 #include "coretypes.h"
 #include "tree.h"
-#include <stdio.h>
-#include <string.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
Index: trans-io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-io.c,v
retrieving revision 1.24
diff -u -b -u -b -B -r1.24 trans-io.c
--- trans-io.c	10 Nov 2004 20:03:21 -0000	1.24
+++ trans-io.c	31 Dec 2004 18:25:56 -0000
@@ -25,11 +25,9 @@
 #include "coretypes.h"
 #include "tree.h"
 #include "tree-gimple.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
-#include <gmp.h>
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"
Index: trans-stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-stmt.c,v
retrieving revision 1.19
diff -u -b -u -b -B -r1.19 trans-stmt.c
--- trans-stmt.c	12 Dec 2004 20:27:00 -0000	1.19
+++ trans-stmt.c	31 Dec 2004 18:25:59 -0000
@@ -26,11 +26,9 @@
 #include "coretypes.h"
 #include "tree.h"
 #include "tree-gimple.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "real.h"
-#include <gmp.h>
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"
Index: trans.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans.c,v
retrieving revision 1.19
diff -u -b -u -b -B -r1.19 trans.c
--- trans.c	30 Oct 2004 14:35:23 -0000	1.19
+++ trans.c	31 Dec 2004 18:26:00 -0000
@@ -24,12 +24,10 @@
 #include "coretypes.h"
 #include "tree.h"
 #include "tree-gimple.h"
-#include <stdio.h>
 #include "ggc.h"
 #include "toplev.h"
 #include "defaults.h"
 #include "real.h"
-#include <gmp.h>
 #include "gfortran.h"
 #include "trans.h"
 #include "trans-stmt.h"


More information about the Gcc-patches mailing list