[Bug c/18930] name clash in C?

jacob at engelbrecht dot dk gcc-bugzilla@gcc.gnu.org
Fri Dec 10 23:30:00 GMT 2004


------- Additional Comments From jacob at engelbrecht dot dk  2004-12-10 23:30 -------
Then I do not understand why the second program is legal?
(After a bit of experimentation I found out that if the type name is used as
variable name then it can not be used as a typename again). I would
Think that either type names are in the same name space as variable names, and
then both programs should be erronous (This I think is correct after rereading K
& R), or they are in different namespaces and then both programs should be
correct (although it might be difficult or impossible to implement). 

The following piece of code does not bark when compiled unless JE is defined

typedef int i;
i main()
{
  i i;
#ifdef JE
  i p;
#endif
  return i = 1;
}

regards

Jacob

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18930



More information about the Gcc-bugs mailing list