This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC/EGCS parser bug


Please take a second look at my example. The reply you gave indicates
that you didn't read the code carefully.

-- Joachim Hollman

Zack Weinberg wrote:
> 
> On Fri, 22 Jan 1999 17:33:56 +0100, Joachim Hollman wrote:
> >GCC/EGCS can't compile the code below unless you remove the typedef.
> [...]
> 
> >typedef void (*func)(int);
> >void f(int i1, void (*func)(void *, void *), int i2);
> 
> This is illegal C. The typedef and the prototype both contain
> file-scope declarations of the identifier "func" with different
> meanings.  The compiler is correct.
> 
> Your code does compile if gcc is asked to treat it as C++.  Perhaps it
> is legal in that language; I don't know enough to say.  C++ source
> code should be in files named `something.cc'.
> 
> zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]