This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Latest gencodes.c is not ISO C compatible
- To: aoliva at redhat dot com
- Subject: Latest gencodes.c is not ISO C compatible
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Thu, 4 Jan 2001 12:04:39 -0500 (EST)
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
Alexandre,
When I bootstrap the latest CVS on irix6.2 or solaris2.7 using cc for
stage1 I get an error compiling gencodes.c. Here is the message from
irix6.2 cc:
> cc -n32 -c -DIN_GCC -g -DHAVE_CONFIG_H -DGENERATOR_FILE
> -I. -I. -I../../egcs-CVS20010104/gcc
> -I../../egcs-CVS20010104/gcc/. -I../../egcs-CVS20010104/gcc/config
> -I../../egcs-CVS20010104/gcc/../include
> ../../egcs-CVS20010104/gcc/gencodes.c
> "../../egcs-CVS20010104/gcc/gencodes.c", line 62: error(1029): expected an
> expression
> {NULL, {}}
> ^
gcc also complains:
> gencodes.c: In function `output_predicate_decls':
> gencodes.c:62: warning: ANSI C forbids empty initializer braces
I believe you introduced this construct. If this patch works for you
I'll install it as an "obvious" fix.
--Kaveh
2001-01-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gencodes.c (output_predicate_decls): Fill empty initializer
braces.
diff -rup orig/egcs-CVS20010104/gcc/gencodes.c egcs-CVS20010104/gcc/gencodes.c
--- orig/egcs-CVS20010104/gcc/gencodes.c Wed Jan 3 16:29:50 2001
+++ egcs-CVS20010104/gcc/gencodes.c Thu Jan 4 11:05:23 2001
@@ -59,7 +59,7 @@ output_predicate_decls ()
RTX_CODE codes[NUM_RTX_CODE];
} *p, predicate[] = {
PREDICATE_CODES
- {NULL, {}}
+ {NULL, {0}}
};
putc ('\n', stdout);