Fw: typedef name question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Any comments are welcomed.

Thanks.

Mike

----- Original Message ----- From: "Michael Gong" <mwgong@xxxxxxxxxxxxxx>
To: <gcc-help@xxxxxxxxxxx>
Sent: Sunday, January 21, 2007 8:55 PM
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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux