This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: multiple definitions of 'xxx keyed to...' in egcs-1.1.1
- To: hjl at lucon dot org
- Subject: Re: multiple definitions of 'xxx keyed to...' in egcs-1.1.1
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Tue, 2 Feb 1999 00:14:28 +0100
- CC: law at cygnus dot com, egcs at egcs dot cygnus dot com
- References: <m107Krt-00038sC@ocean.lucon.org>
> Do 'D' and 'I' have to be global?
I'm not sure. As you've found, they don't have to be for ELF. I don't
know what the rationale was for making them global; it seems this
knowledge is lost...
> I am not sure if we should worry about anonymous namespaces. What
> will happen when 2 anonymous namespaces have the same name?
Bad things. Anonymous namespaces allow you to put
namespace{
int dummy;
}
into a header file, and you should get a different variable in each
object file. More importantly, you can do
namespace{
class Handle{
Handle(){}
};
}
in an implementation and expect that it won't clash with somebody
else's Handle class. If the two anonymous namespaces have the same
name, you'll get a clash.
Regards,
Martin