This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Latest gencodes.c is not ISO C compatible
On Jan 4, 2001, Michael Meissner <meissner@cygnus.com> wrote:
> Trailing comma on array and struct initializers is in ISO C as well as the
> original K&R.
Thanks for the confirmation. Ok to install? (tested on
i686-pc-linux-gnu to generate the same insn-codes.h as before)
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* gencodes.c (output_predicate_decls): Remove empty initializer.
Index: gcc/gencodes.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gencodes.c,v
retrieving revision 1.36
diff -u -p -r1.36 gencodes.c
--- gcc/gencodes.c 2001/01/04 18:08:22 1.36
+++ gcc/gencodes.c 2001/01/04 19:35:54
@@ -57,16 +57,16 @@ output_predicate_decls ()
static struct {
const char *name;
RTX_CODE codes[NUM_RTX_CODE];
- } *p, predicate[] = {
+ } predicate[] = {
PREDICATE_CODES
- {NULL, {0}}
};
-
+ int i;
+
putc ('\n', stdout);
puts ("struct rtx_def;\n#include \"machmode.h\"\n");
- for (p = predicate; p->name; p++)
+ for (i = 0; i < sizeof predicate / sizeof *predicate; i++)
printf ("extern int %s PARAMS ((struct rtx_def *, enum machine_mode));\n",
- p->name);
+ predicate[i].name);
putc ('\n', stdout);
#endif
}
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me