This is the mail archive of the gcc@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: multiple definitions of 'xxx keyed to...' in egcs-1.1.1


> 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


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