ABI changes between VC++6.0 and VC++9.0

  • Thread starter Michael Harbeck
  • Start date
M

Michael Harbeck

Are there any changes in the Application Binary Interface (ABI) of the Visual
C / C++ Versions 6.0 and 9.0, or is it possible to link code generated with
9.0 to old 6.0 Libraries/Object files?
 
D

David Lowndes

Are there any changes in the Application Binary Interface (ABI) of the Visual
C / C++ Versions 6.0 and 9.0, or is it possible to link code generated with
9.0 to old 6.0 Libraries/Object files?

Michael,

I'd have thought you'd be OK with linking to functions that accept
only plain old data types, but of course you'll have issues if you're
dependent on sharing 'C' run-time allocated objects across the
boundary.

Dave
 
J

Jonathan Wilson

Michael said:
Are there any changes in the Application Binary Interface (ABI) of the Visual
C / C++ Versions 6.0 and 9.0, or is it possible to link code generated with
9.0 to old 6.0 Libraries/Object files?
Based on my experience, if you are linking both obj files or lib files to
the same copy of e.g. malloc/free/new/delete (or anything else that would
allocate memory), it should work.
I have some Visual C++ 6 code and some Visual C++ 9 code that is talking to
each other and both are using the same memory manager. I havent experienced
any issues that relate to the mixing of code. (the code is full on C++ with
multiple inheritance, operator overloading, virtual functions and more)

If you are dealing with exception handling (especially exception handling
in a dll) you may have issues (I cant remember what I did with that). You
may also have problems with the STL (e.g. std::string, std::vector etc)
 
C

Carl Daniel [VC++ MVP]

Michael said:
Are there any changes in the Application Binary Interface (ABI) of
the Visual C / C++ Versions 6.0 and 9.0, or is it possible to link
code generated with
9.0 to old 6.0 Libraries/Object files?

Yes and no.

If the older files are plain old C, then you shouldn't have any problems.

If the older files are C++ but do not use the C++ standard library (at
all!), then you can probably mix them into a VC9 build without issues. If
they make any use of the C++ standard library, then you most likely cannot
mix them without problems.

There are a couple of changes that might still cause issues with C++ code:

- There was a change in name decoration for wchar_t, which was a typedef in
VC6 but is a distinct type in VC9. You can make VC9 match the VC6 behavior
with /Zc:wchar_t-

- There was a change in name decoration for function templates. Under VC6,
an instantiation of a function template had the same decorated name as a
non-template function with the same name, parameters and return type. Under
VC9 these are distinct names, and there's no way to get the old behavior
(which was fundamentally broken, really).

- There was a change in exception handling with regard to catch(...) and
Win32 structured exceptions. Under VC6, catch(...) would always catch
structured exceptions, while under VC9, that only occurs if the code is
compiled with /EHa. This change does not effect linkability, but it may
lead to differences at runtime due to the different catch behavior.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top