This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [PATCH] Fix includes of sparseset.*


On Wed, Nov 28, 2007 at 10:44:12AM -0700, Tom Tromey wrote:
>>>>>> "Bernhard" == Bernhard Fischer <rep.dot.nop@gmail.com> writes:
>
>Bernhard> 	* sparseset.h: Include config.h before system.h
>Bernhard> 	* sparseset.c: Remove inclusion of libiberty.h
>
>I think it is a bit odd to include config.h from a header.
>
>Instead, I think as a rule every .c file should include config.h as
>the first header.

Updated patch attached. Bootstrapped and regtested on i386-linux-gnu
without any new regression. Ok for trunk?

gcc/ChangeLog:
2007-11-27  Bernhard Fischer  <>

        * sparseset.c: Include config.h and system.h before sparseset.h.
        * sparseset.h: Remove inclusion of system.h.


thanks,
Index: gcc-4.3/gcc/sparseset.c
===================================================================
--- gcc-4.3/gcc/sparseset.c	(revision 130499)
+++ gcc-4.3/gcc/sparseset.c	(working copy)
@@ -18,10 +18,10 @@ You should have received a copy of the G
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-#include "libiberty.h"
+#include "config.h"
+#include "system.h"
 #include "sparseset.h"
 
-
 /* Allocate and clear a n_elms SparseSet.  */
 
 sparseset
Index: gcc-4.3/gcc/sparseset.h
===================================================================
--- gcc-4.3/gcc/sparseset.h	(revision 130499)
+++ gcc-4.3/gcc/sparseset.h	(working copy)
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3.  
 #ifndef GCC_SPARSESET_H
 #define GCC_SPARSESET_H
 
-#include "system.h"
 #include <assert.h>
 
 #define SPARSESET_ELT_BITS ((unsigned) HOST_BITS_PER_WIDEST_FAST_INT)
@@ -32,7 +31,7 @@ along with GCC; see the file COPYING3.  
 typedef struct sparseset_def
 {
   SPARSESET_ELT_TYPE *dense;	/* Dense array.  */
-  SPARSESET_ELT_TYPE *sparse; 	/* Sparse array.  */
+  SPARSESET_ELT_TYPE *sparse;	/* Sparse array.  */
   SPARSESET_ELT_TYPE members;	/* Number of elements.  */
   SPARSESET_ELT_TYPE size;	/* Maximum number of elements.  */
   SPARSESET_ELT_TYPE iter;	/* Iterator index.  */

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