This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
typedef name question
- From: "Michael Gong" <mwgong at cs dot utoronto dot ca>
- To: <gcc-help at gcc dot gnu dot org>
- Date: Sun, 21 Jan 2007 20:55:18 -0500
- Subject: typedef name question
Hi, gcc developers,
I have 2 following programs, and both are compiled fine by gcc:
/* t1.c */
typedef int myint;
int foo() {
int myint;
myint * myint; /* an expression: variable "myint" * "myint" */
}
/* t2.c */
typedef int myint;
int foo() {
myint * myint; /* a declaration for pointer variable "myint" */
}
As you can see, the "myint * myint" could have different interperation
depending on previous declarations. I am wondering how gcc distinguish
them ? Is it done during parsing step or during semantic checking step ?
Thanks.
Mike