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
- To: Alexandre Oliva <aoliva at redhat dot com>
- Subject: Re: Latest gencodes.c is not ISO C compatible
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Thu, 4 Jan 2001 13:31:40 -0500
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <200101041704.MAA23478@caip.rutgers.edu> <org0iztcto.fsf@guarana.lsd.ic.unicamp.br>
On Thu, Jan 04, 2001 at 04:02:59PM -0200, Alexandre Oliva wrote:
> On Jan 4, 2001, "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote:
>
> > Alexandre,
>
> Hi, Kaveh!
>
> > When I bootstrap the latest CVS on irix6.2 or solaris2.7 using cc for
> > stage1 I get an error compiling gencodes.c.
>
> Oops.
>
> > 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.
>
> Yep. Sorry, I hadn't noticed the warning :-(
>
> > If this patch works for you I'll install it as an "obvious" fix.
>
> I'd rather remove the NULL entry entirely, but I realize
> PREDICATE_CODES is supposed to end with a comma, and I'm not sure a
> trailing comma is acceptable in an array initializers (or if there are
> compilers that would choke on it even if it's acceptable). Does
> anybody know for sure?
Trailing comma on array and struct initializers is in ISO C as well as the
original K&R. As I recall, it was specifically mentioned in K&R that it was
there to allow new elements to be added without modifying the previous line.
On the other hand, trailing commas are not allowed in enum list, except as a
GCC extension.
--
Michael Meissner, Red Hat, Inc. (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482