This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++: "unqualified" linkage


"Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> writes:

| This patch implements a feature that was requested from the libstdc++
| v3 people a long time ago. It adds a new language linkage
| "unqualified". The primary application is in cases like
| 
| namespace std{
|   extern "unqualified"{
|     struct timeval{};
|   }
| }
| using std::timeval;
| 
| void gettime(timeval& x)
| {
| }
| 
| If std:: is honored, the mangling of gettime would normally change if
| the old-style header file is included instead of the C++ conforming
| one. See docs/17_intro/DESIGN of libstdc++ v3 for more discussion.
| 
| In this patch, "unqualified" linkage is the same as "C" linkage, with
| the additional meaning that "unqualified" names used in mangling of
| "C++" names are mangled without qualifiers. As a result, gettime is
| mangled as gettime__FR7timeval, instead of gettime__FRQ23std7timeval.
| 
| Any comments appreciated.

Hi Martin,

Firstly, thanks a lot for your effort to implement this extension.
I didn't (yet) test your patch on libstdc++-v3 (because of some
obscure build failures with 'plain' CVS source).  We can now dream of
a conforming C-headers :-)

I have one stylistic comment.  The name 'unqualified' doesn't seem to
be very descriptive, as 'qualified' or 'unqualified' is an overloaded
term in C++.  Nathan was suggesting 'C-global'.  What is wrong with
that? 

Anyway, thanks.

-- Gaby

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]