Re: Carbon with UNIX
Re: Carbon with UNIX
- Subject: Re: Carbon with UNIX
- From: Clark Cox <email@hidden>
- Date: Tue, 18 Jan 2005 11:13:19 -0500
On Mon, 17 Jan 2005 22:43:07 +1030, Rhys Hill <email@hidden> wrote:
> Isn't it just because in the headers, the struct in question is included
> within extern "C" directives, and hasn't been typedef'd to remove the
> struct
> keyword?
In a word: No.
The issue is that there is a function and a structure with the same
name. In C, structure names and function names exist in different
namespaces (i.e. "stat" by itself is a function pointer, while "struct
stat" is the name of a structure type). In C++, "struct stat {};"
creates three different names that all refer to the same type "struct
stat", "class stat" and "stat". It's this last one that conflicts with
the function of the same name. In such a case, in C++, you have to
disambiguate "stat" by adding the struct or class keyword. Whether or
not the function is extern "C" has no bearing on the naming conflict.
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden