This is the mail archive of the gcc@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


> > This is what I thought. Then what about the original example?
> > 
> > typedef void (*func)(int);
> > void f(int i1, void (*func)(void *, void *), int i2);
> > 
> > Shouldn't the prototype of f open a new scope, shadowing the previous
> > (global) definition of func? Shouldn't that happen regardless of whether
> > the previous definition was a typedef or an object?
> 
> No, because a typedef changes the type of lexical token of the affected
> symbol.

I'm lost. Why doesn't it 'change the type of lexical token' in

typedef void (*func)(int);

void f()
{
  void (*func)(void*,void*);
  func(0,0);
}

And I thought I understood C...

Martin


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