Problem with `string', threading and shared libraries.

Tim Hollebeek tim@hollebeek.com
Fri Sep 28 17:32:00 GMT 2001


On Fri, Sep 28, 2001 at 11:33:27PM +0200, Gabriel Dos Reis wrote:
> Alexandre Oliva <aoliva@redhat.com> writes:
> 
> | On Sep 28, 2001, Carlo Wood <carlo@alinoe.com> wrote:
> | 
> | > I was wondering, how can it be that `string' has a different
> | > mangling on different compilers/machines?  Isn't that a bug?
> | 
> | Well, it can be argued that they are actually two different classes,
> 
> If they are really considered to be two different classes, then
> "std::string" is a truly bad choice.  
> 
> I don't think V3 should take that word-game stance.

C++ implicitly encourages incompatible implementations to have
incompatible mangling schemes.  In the absence of a guarantee (at the
ABI level) that types are compatible, they should have distinct names.

Compatibility of types within ABI families is a useful goal, but where
it doesn't exist (even if only because of threading issues, etc), then
compilers should not compile code just because it "probably" will work.

-Tim



More information about the Gcc-bugs mailing list