This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiling GCC with g++: a report
> The cases I've found in my conversion was when codes use plain
> "0" instead of VOIDmode or whatever machine_mode is appropriate.
> That use of plain 0 breaks compilation with a C++ compiler.
If the #include isn't portable enough, just hard code a 42. We'd need
suitable changes for insn-modes.c et al (null mode_names should stop
some of them!), but this was just to give you the idea ;-)
Index: genmodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genmodes.c,v
retrieving revision 1.15
diff -p -U3 -r1.15 genmodes.c
--- genmodes.c 15 Oct 2004 14:47:07 -0000 1.15
+++ genmodes.c 25 May 2005 02:02:14 -0000
@@ -24,6 +24,10 @@ Software Foundation, 59 Temple Place - S
#include "errors.h"
#include "hashtab.h"
+static int some_random_number =
+#include "DATESTAMP"
+;
+
/* enum mode_class is normally defined by machmode.h but we can't
include that header here. */
#include "mode-classes.def"
@@ -780,6 +784,8 @@ emit_insn_modes_h (void)
\n\
enum machine_mode\n{");
+ printf(" MIN_MACHINE_MODE = %d,\n", some_random_number % 10 + 5);
+
for (c = 0; c < MAX_MODE_CLASS; c++)
for (m = modes[c]; m; m = m->next)
{