Re: multi calling convention libraries

Alan Donovan <adonovan@imerge.co.uk>
2 Nov 1999 00:34:09 -0500

          From comp.compilers

Related articles
multi calling convention libraries Wolfgang.Hospital@Materna.DE (1999-10-31)
Re: multi calling convention libraries adonovan@imerge.co.uk (Alan Donovan) (1999-11-02)
| List of all articles for this month |
From: Alan Donovan <adonovan@imerge.co.uk>
Newsgroups: comp.compilers
Date: 2 Nov 1999 00:34:09 -0500
Organization: Imerge Ltd.
References: 99-10-183
Keywords: linker

Why bother? All it takes is a slight change to a calling convention
and your libraries are all obsolete, and what's worse, probably
pathological. I think it would also violate the spirit of the ANSI C++
standard on mangling.


Presuming here you're talking about C++, it's possible to design
libraries carefully such that they can be used in a binary-compatible
way between different compilers (look at COM or CORBA for examples).


The key is not to export mangled names, but to export extern "C"
functions that return pointers to objects. These objects are opaque to
the library, but the interface to the object is defined in an pure
abstract base class.


What is the higher-level problem you are trying to solve?


alan


Wolfgang.Hospital@Materna.DE wrote:
>
> I have been toying around with the idea of including entry points
> (symbols and code) for several calling conventions in one library
------------------------------------------------------------------------
    Alan Donovan adonovan@imerge.co.uk http://www.imerge.co.uk
    Imerge Ltd. +44 1223 875265


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.