C++ parser bug?

Charles M. Hannum mycroft@mit.edu
Thu Apr 23 18:49:00 GMT 1998


This seems to be a new bug in egcs 1.0.2 (since gcc 2.7.2.2).  The
following code generates syntax errors:

extern "C" {
struct proc;
extern void Tcl_SetPanicProc (void (*proc) (char *format, ...));
};

# c++ -O2 -S bar.i
bar.i:3: syntax error before `)'
bar.i:3: syntax error before `)'
# 

Apparently there's some confusion here because `proc' is already
defined as a structure name.

Oddly, the following actually compiles:

extern "C" {
struct proc;
extern int proc;
extern void Tcl_SetPanicProc (void (*proc) (char *format, ...));
};

(This bug causes vic and vat to not compile with egcs.)




More information about the Gcc mailing list