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]
Other format: [Raw text]

Re: Duplicate data objects in shared libraries


>>>>> "Mark" == Mark Mitchell <mark@codesourcery.com> writes:

> What about:

> static void f() { struct S { virtual void g(); }; }

> There's no guarantee that the name in the RTTI for S will be different
> from a similar class in another translation unit -- but it is true that
> the NTBS will be at a different address since it will be allocated with
> internal linkage.

> In other words, is it really true that comparison by address is just
> an optimization, and not a correctness issue?

A good point, though we could handle this by decorating the RTTI name for S
with the unnamed namespace qualifier.  I suppose this sort of thing is what
leads people to want to remove internal linkage entirely.

Jason


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