From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Xref: utzoo comp.lang.c:37596 comp.lang.c++:12487 comp.lang.ada:5085 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!casbah.acns.nwu.edu!ftpbox!motsrd!motcid!crocker From: crocker@motcid.UUCP (Ronald T. Crocker) Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.ada Subject: C functions calling {C++/Ada/...} functions Message-ID: <4881@berry19.UUCP> Date: 26 Mar 91 19:50:17 GMT Reply-To: crocker@mot.com Organization: Motorola Inc., Cellular Infrastructure Div., Arlington Heights, IL List-Id: I'm looking at building a software system where (generated) C functions must call some library functions. The library functions are currently in both C++ and Ada; they don't have too many problems calling C functions. The major problem that I'm having is having the C functions call the C++ and Ada code. Is there something that I can do mechanically to set up interfaces between C functions and C++ or Ada functions. In particular: + Do I have to worry about stack frame argument positions. I know that C++ uses C function calling conventions because it generates C code. Does Ada use the same calling conventions? Is this a compiler-dependent problem? + Are there run-time type-conversion problems that I might run into? Again, C++ == C in this regard, but what about Ada? + How do I know what the name of the (C++/Ada) function that I want to call is? The C++ function A::f can't be called like that from a C program; it simply doesn't know what that is. The same problem exists for Ada. Is there a simple approach to this problem? Is this compiler dependent? Please respond via email to crocker@mot.com. I'll summarize and post if there is enough interest. -- Ron Crocker Motorola Radio-Telephone Systems Group, Cellular Infrastructure Group (708) 632-4752 [FAX: (708) 632-4430] crocker@mot.com or uunet!motcid!crocker