A FrontEnd in C++?
Robert Dewar
dewar@gnat.com
Thu Aug 22 01:54:00 GMT 2002
> historically, very little effort has been put into
> maintaining that compatibility (beyond what is needed to interface the
> language runtime to the system), so it is not a thing to be relied on.
While this statement is absolutely true about C, which has never had any
facilities for interfacing with other languages, it takes only one to tango
here, and other languages *do* concern themselves with multi-language
programming. For example in Ada a required feature is
pragma Import (C, name-of-function-in-Ada, name-of-function-in-C);
and the compiler is *required* to make sure that the calling sequence is
C-compatible.
Actually in the case of GNAT, we don't even need to use pragma Import, since
the default calling convention is precisely compatible with C anyway.
More information about the Gcc
mailing list