Re: ADA/C++ Compatibility problems

bobduff@world.std.com (Robert A Duff)
Mon, 21 Aug 1995 16:43:46 GMT

          From comp.compilers

Related articles
ADA/C++ Compatibility problems dasilvia@sonalysts.com (1995-08-18)
Re: ADA/C++ Compatibility problems papayd@gtewd.mtv.gtegsc.com (Dave Papay M/S 7G32 x2791) (1995-08-21)
Re: ADA/C++ Compatibility problems bobduff@world.std.com (1995-08-21)
Re: ADA/C++ Compatibility problems stachour@klondike.winternet.com (1995-08-25)
Re: ADA/C++ Compatibility problems jan@neuroinformatik.ruhr-uni-bochum.de (1995-08-30)
Re: ADA/C++ Compatibility problems gbaker@rp.CSIRO.AU (1995-09-07)
Re: ADA/C++ Compatibility problems jan@neuroinformatik.ruhr-uni-bochum.de (1995-09-07)
Re: ADA/C++ Compatibility problems leichter@zodiac.rutgers.edu (1995-09-07)
Re: ADA/C++ Compatibility problems przemek@rrdjazz.nist.gov (1995-09-13)
[2 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: bobduff@world.std.com (Robert A Duff)
Keywords: Ada, C++
Organization: The World Public Access UNIX, Brookline, MA
References: 95-08-127
Date: Mon, 21 Aug 1995 16:43:46 GMT

David Sivia <dasilvia@sonalysts.com> wrote:
> A test program was written to test the ability to have an ADA main
>calling a C function which is an interface to a C++ method....


The problem is that Ada and C++ both have the notion of "stuff that has
to happen before the main program". The Ada 95 standard makes this
easier by defining a linker symbol "adainit", which is a procedure that
encapsulates all that "stuff" from the Ada side. See B.1(39) of the Ada
95 Reference Manual. There's also an interface for the finalization
side of things (Ada and C++ both have finalization).


If you use GNAT (the GNU Ada compiler), there is a more straightforward
interface to C++, with no need to go through C. Ada has dispatching
functions that can interface directly to C++ virtual functions.


- Bob
--


Post a followup to this message

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