S
S.Tobias
typedef int myint;
struct s
{
myint myint; /* 1 */
} s;
int main()
{
myint myint; /* 2 */
s.myint = 5; /* 1 */
myint = 1; /* 2 */
return myint; /*kill warning*/
}
What is interesting to me is case 2. "Typedef myint" and "object myint"
identifiers belong to the same name space, so I think there should
be a conflict (there's no conflict in case 1 - members have a name
space of their own). However, two compilers accepted the above code.
struct s
{
myint myint; /* 1 */
} s;
int main()
{
myint myint; /* 2 */
s.myint = 5; /* 1 */
myint = 1; /* 2 */
return myint; /*kill warning*/
}
What is interesting to me is case 2. "Typedef myint" and "object myint"
identifiers belong to the same name space, so I think there should
be a conflict (there's no conflict in case 1 - members have a name
space of their own). However, two compilers accepted the above code.