[commit] language.h minor cleanup

Daniel Jacobowitz drow@false.org
Mon Dec 17 13:31:00 GMT 2007


On Mon, Dec 17, 2007 at 02:45:47PM +0400, Joel Brobecker wrote:
> > As far as I know the comment:
> > 
> > > -/* enum exp_opcode;     ANSI's `wisdom' didn't include forward enum decls. */
> > 
> > is right, so you shouldn't have comitted this :(.  Perhaps it is now a
> > GCC extension to allow these, but as far as I remember older versions
> > of GCC didn't accept this.
> 
> I thought that we changed the requirement to C90 which should accept this.
> I was comforted in this direction by the fact that we already use this
> paradigm elsewhere so I thought it was OK.

Nope, sorry.

C99, 6.7.2.3#2:

A type specifier of the form
       enum identifier
without an enumerator list shall only appear after the type it
specifies is complete.

drow@caradoc:~% gcc -c q.c -Wall -std=c99 -pedantic
q.c:1: warning: ISO C forbids forward references to `enum' types

If we use it elsewhere, we should stop.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list