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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6e688afdbf4b6072 X-Google-Attributes: gid103376,public From: comar@cs.nyu.edu (Cyrille Comar) Subject: Re: Calling Ada from C Date: 1995/03/28 Message-ID: <3la2b8$62b@gnat.cs.nyu.edu>#1/1 X-Deja-AN: 100540693 references: <3l6j5k$h05@theopolis.orl.mmc.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1995-03-28T00:00:00+00:00 List-Id: dennison@escmail.orl.mmc.com (Theodore Dennison) writes: : Robert Dewar writes: : : > GNAT certainly allows the main program to be in a language other than C : > with no restrictions (in fact the main program of the *all* GNAT programs : > is typically in C, since that's what the binder generates). But you can : > also have your own explicit main program. : : With NO restrictions? What kind of restrictions would you like? I don't see any need for restrictions. "gnat1" the core of the gnat compiler is such a program, for instance... :Including tasking? Why not? I don't see any problem with that. : The C program doesn't have to make : any special calls to elaborate everything? : You need to elaborate the non-preelaborable compilation units you want to use. The binder (gnatbind) generates a procedure with the appropriate calls, there is a special option to use when the main program is not Ada. You also need to finalize the library level controlled objects if you want a fully consistant system. This part is not very documented yet but it is quite simple to mimic the code generated by the binder for the case where the main program is an Ada procedure... -- ------------------------------------------------------------------------ Cyrille Comar, E-mail: comar@cs.nyu.edu Gnat Project US phone: (212) 998-3489