This is the mail archive of the gcc@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]

ANSI C compiler required to build GCC from CVS?


The bundled HP non-ANSI C compiler built GCC 2.95.2 just fine. However, it
doesn't work with GCC from CVS:

cc -c  -DIN_GCC    -g   -DHAVE_CONFIG_H    -I. -I../../gcc
-I../../gcc/config -I../../gcc/../include ../../gcc/flow.c
cpp: "stddef.h", line 14: warning 2001: Redefinition of macro offsetof.
cc: "../../gcc/flow.c", line 7358: error 1000: Unexpected symbol: "FILE".
cc: "../../gcc/flow.c", line 7358: error 1705: Function prototypes are an ANSI feature.
cc: "../../gcc/flow.c", line 7358: error 1573: Type of "<<<NULL_SYMBOL>>>" is undefined due to an illegal declaration.
cc: "../../gcc/flow.c", line 7392: warning 563: Argument #2 is not the correct type.
cc: "../../gcc/flow.c", line 7402: error 1000: Unexpected symbol: "FILE".
cc: "../../gcc/flow.c", line 7402: error 1705: Function prototypes are an ANSI feature.
cc: "../../gcc/flow.c", line 7402: error 1573: Type of "<<<NULL_SYMBOL>>>" is undefined due to an illegal declaration.
gmake[2]: *** [flow.o] Error 1
gmake[2]: Leaving directory `/opt/build/gcc-2.96/objdir/gcc'

The offending lines from gcc/flow.c are:
7354: void
7355: flow_loop_dump (loop, file, loop_dump_aux, verbose)
7356:      const struct loop *loop;
7357:      FILE *file;
7358:      void (*loop_dump_aux)(const struct loop *, FILE *, int);
7359:      int verbose;

How about changing line 7358 to:
	void (*loop_dump_aux)();

7398: void 
7399: flow_loops_dump (loops, file, loop_dump_aux, verbose)
7400:      const struct loops *loops;
7401:      FILE *file;
7402:      void (*loop_dump_aux)(const struct loop *, FILE *, int);
7403:      int verbose;

How about changing line 7402 to:
	void (*loop_dump_aux)();

After applying the above I get:
cc -c  -DIN_GCC    -g   -DHAVE_CONFIG_H    -I. -I../../gcc
-I../../gcc/config -I../../gcc/../include ../../gcc/cppinit.c
cc: "../../gcc/cppinit.c", line 408: error 1705: Function prototypes
are an ANSI feature.

The offending line is:
407: void
408: cpp_init (void)
409: {

Line 408 should be:
	cpp_init ()

-- 
albert chin (china@thewrittenword.com)

-- snip snip
--- gcc/flow.c.orig	Mon Sep 18 00:17:46 2000
+++ gcc/flow.c	Mon Sep 18 00:18:05 2000
@@ -7355,7 +7355,7 @@
 flow_loop_dump (loop, file, loop_dump_aux, verbose)
      const struct loop *loop;
      FILE *file;
-     void (*loop_dump_aux)(const struct loop *, FILE *, int);
+     void (*loop_dump_aux)();
      int verbose;
 {
   if (! loop || ! loop->header)
@@ -7399,7 +7399,7 @@
 flow_loops_dump (loops, file, loop_dump_aux, verbose)
      const struct loops *loops;
      FILE *file;
-     void (*loop_dump_aux)(const struct loop *, FILE *, int);
+     void (*loop_dump_aux)();
      int verbose;
 {
   int i;
--- gcc/cppinit.c.orig	Mon Sep 18 00:17:50 2000
+++ gcc/cppinit.c	Mon Sep 18 00:17:56 2000
@@ -405,7 +405,7 @@
 static int cpp_init_completed = 0;
 
 void
-cpp_init (void)
+cpp_init ()
 {
 #ifdef HOST_EBCDIC
   /* For non-ASCII hosts, the cl_options array needs to be sorted at

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