[commit] language.h minor cleanup

Joel Brobecker brobecker@adacore.com
Mon Dec 17 14:22:00 GMT 2007

> q.c:1: warning: ISO C forbids forward references to `enum' types
> If we use it elsewhere, we should stop.

Humpf, sorry about that. I have reverted this part of my patch
as follow:

2007-12-17  Joel Brobecker  <brobecker@adacore.com>

        * language.h (enum exp_opcode): Comment out this declaration,
        undoing the previous change.

Re-tested on x86-linux with a full rebuild. The situation is not
completely fixed yet, but we can discuss our options.

In terms of other places where it is used, I thought there were
several but a quick grep revealed only two:
  - language.h (our case, enum exp_opcode)
  - symtab.h (enum language)

Unless my egrep command is wrong, I must have some delusional episodes:
        % grep -E -e 'enum +[_0-9a-zA-Z]+;' **/*.h

I will send some patches ASAP.

Joel (UTC+4 for the next 5 weeks :-).
-------------- next part --------------
Index: language.h
RCS file: /cvs/src/src/gdb/language.h,v
retrieving revision 1.44
diff -u -p -r1.44 language.h
--- language.h	17 Dec 2007 07:00:49 -0000	1.44
+++ language.h	17 Dec 2007 14:04:59 -0000
@@ -30,7 +30,8 @@ struct objfile;
 struct frame_info;
 struct expression;
 struct ui_file;
-enum exp_opcode;
+/* enum exp_opcode;     ANSI's `wisdom' didn't include forward enum decls. */
 /* This used to be included to configure GDB for one or more specific
    languages.  Now it is left out to configure for all of them.  FIXME.  */

More information about the Gdb-patches mailing list