This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: typedef name question


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




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