This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch installed for multiple inclusion problem with output.h
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 Jun 2003 10:23:17 -0400 (EDT)
- Subject: Patch installed for multiple inclusion problem with output.h
Bootstrapping on mips-irix6 last night after installing my asm_fprintf
checking patch revealed a problem with multiple inclusion of output.h:
> output.h:113: error: redefinition of `__gcc_host_wide_int__'
> output.h:113: error: `__gcc_host_wide_int__' previously declared here
> make[2]: *** [mips.o] Error 1
Basically, mips.c includes output.h twice and output.h is not guarded
against this. The fix is to not include it twice or wrap output.h in
a macro guard. I did both. I also checked for other cases of
including output.h more than once and found two other places, so I
fixed those also.
Tested by building cc1 hosted on sparc-solaris2.7 and targetted to
mips-sgi-irix6.5, xtensa-unknown-elf and xstormy16-unknown-elf. I
also did a full bootstrap native on mips-sgi-irix6.5.
I installed it as "obvious".
--Kaveh
2003-06-02 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* mips.c: Don't include output.h twice.
* stormy16.c: Likewise.
* xtensa.c: Likewise.
* output.h: Protect against multiple inclusion.
diff -rup orig/egcc-CVS20030601/gcc/config/mips/mips.c egcc-CVS20030601/gcc/config/mips/mips.c
--- orig/egcc-CVS20030601/gcc/config/mips/mips.c 2003-05-30 20:01:28.000000000 -0400
+++ egcc-CVS20030601/gcc/config/mips/mips.c 2003-06-02 07:55:45.377187710 -0400
@@ -47,7 +47,6 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "flags.h"
#include "reload.h"
-#include "output.h"
#include "tm_p.h"
#include "ggc.h"
#include "gstab.h"
diff -rup orig/egcc-CVS20030601/gcc/config/stormy16/stormy16.c egcc-CVS20030601/gcc/config/stormy16/stormy16.c
--- orig/egcc-CVS20030601/gcc/config/stormy16/stormy16.c 2003-05-24 20:01:18.000000000 -0400
+++ egcc-CVS20030601/gcc/config/stormy16/stormy16.c 2003-06-02 07:56:05.366077059 -0400
@@ -40,7 +40,6 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "expr.h"
#include "optabs.h"
-#include "output.h"
#include "except.h"
#include "function.h"
#include "target.h"
diff -rup orig/egcc-CVS20030601/gcc/config/xtensa/xtensa.c egcc-CVS20030601/gcc/config/xtensa/xtensa.c
--- orig/egcc-CVS20030601/gcc/config/xtensa/xtensa.c 2003-05-29 20:01:57.000000000 -0400
+++ egcc-CVS20030601/gcc/config/xtensa/xtensa.c 2003-06-02 07:56:20.035362017 -0400
@@ -43,7 +43,6 @@ Software Foundation, 59 Temple Place - S
#include "function.h"
#include "toplev.h"
#include "optabs.h"
-#include "output.h"
#include "libfuncs.h"
#include "ggc.h"
#include "target.h"
diff -rup orig/egcc-CVS20030601/gcc/output.h egcc-CVS20030601/gcc/output.h
--- orig/egcc-CVS20030601/gcc/output.h 2003-06-01 21:39:16.000000000 -0400
+++ egcc-CVS20030601/gcc/output.h 2003-06-02 07:57:21.362016343 -0400
@@ -20,6 +20,9 @@ along with GCC; see the file COPYING. I
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+#ifndef GCC_OUTPUT_H
+#define GCC_OUTPUT_H
+
/* Compute branch alignments based on frequency information in the CFG. */
extern void compute_alignments PARAMS ((void));
@@ -536,3 +539,5 @@ extern void assemble_vtable_inherit PARA
struct rtx_def *));
extern int default_address_cost PARAMS ((rtx));
+
+#endif /* ! GCC_OUTPUT_H */