This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC/EGCS parser bug
- To: Zack Weinberg <zack at rabi dot columbia dot edu>
- Subject: Re: GCC/EGCS parser bug
- From: Joachim Hollman <Joachim dot Hollman at front dot se>
- Date: Thu, 04 Feb 1999 14:14:58 +0100
- Cc: egcs-bugs at cygnus dot com
- References: <199901221847.NAA19400@blastula.phys.columbia.edu>
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