This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: typedef name question
- From: "Michael Gong" <mwgong at cs dot utoronto dot ca>
- To: "John Love-Jensen" <eljay at adobe dot com>
- Cc: <gcc-help at gcc dot gnu dot org>
- Date: Tue, 23 Jan 2007 09:49:52 -0500
- Subject: Re: typedef name question
- References: <C1DB753D.1B9F0%eljay@adobe.com>
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