This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++: "unqualified" linkage
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: C++: "unqualified" linkage
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 17 Jan 2000 19:39:11 +0100
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <200001160054.BAA31240@loewis.home.cs.tu-berlin.de>
- Reply-To: gcc-patches at gcc dot gnu dot org
"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