typedef name question

Michael Gong mwgong@cs.utoronto.ca
Tue Jan 23 14:50:00 GMT 2007


Hi, John,

Thanks for replying.
To clarify myself a bit, is my following understanding correct ?

For this case:
    int main() {
        int foo;
        foo abc;
    }
The Gcc's grammar does parse it, ie. an "identifier" can follow another 
"identifier".
Then in the semantic analysis, gcc checks to make sure the first 
identifier "foo" must represent a type. In this case, it is not. So an 
error is reported.

Thanks.

Mike





----- Original Message ----- 
From: "John Love-Jensen" <eljay@adobe.com>
To: "Michael Gong" <mwgong@cs.toronto.edu>; "MSX to GCC" 
<gcc-help@gcc.gnu.org>
Sent: Tuesday, January 23, 2007 9:18 AM
Subject: Re: typedef name question


> Hi Michael,
>
> GCC distinguishes between them by context and visibility during 
> semantic
> analysis.
>
> They cannot be distinguished during syntactic analysis.
>
> HTH,
> --Eljay
>
> 



More information about the Gcc-help mailing list