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: egcs 1.2 C++ ABI (Re: C++: STL 3.2)


> This is OK; so long as the data structures are similar enough the only harm
> would be having two copies of the code in the executable.

It depends on the application. Consider

#include <vector>

extern void foo(vector<int>&);

int main()
{
  vector<int> s;
  foo(s);
}

If foo is implemented in a library, and the library was compiled with
1.1, it cannot be linked with egcs 1.2: The error message would say

/tmp/ccKWdaaa.o(.text+0x4e): undefined reference to `foo(vector<int, allocator<int> > &)

which *will* confuse people who are certain that they implemented foo
Of course, they implemented 
foo(vector<int, __default_alloc_template<true, 0> > &)
instead.

> But it is backward compatible.  I don't mind requiring people to use
> the newest compiler to link mixed code.

Ok. So 1.2 is backwards-compatible in the sense that you can link 1.1
libraries into 1.2 applications, right? (Unless they use STL).

Regards,
Martin



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