fortran to C converter

Henry Spencer henry at utzoo.uucp
Fri Apr 14 03:33:31 AEST 1989


In article <11926 at lanl.gov> jlg at lanl.gov (Jim Giles) writes:
>...all the primitive operations on 'objects'
>in C++ is done with procedure calls.  So the translation of the following
>would contain two procedure call overheads:
>
>      COMPLEX A,B,C
>      ...
>      A=B*C
>
>... I've not heard that inlining is available on
>any C++ presently marketed.

In any sensible implementation of "complex" in any sensible C++ compiler,
that code will get inlined, because the declarations of the = and *
operators (in a .h file, usually) will contain the definitions and the
compiler will therefore inline them.  No procedure calls needed.

Nobody would use C++ if everything required procedure calls, as is the
case in all too many other object-oriented languages.  C++ has a lot of
warts; the ability to produce efficient code is what's won it so many
friends in spite of its problems.

If you want general inlining without having to carefully ask for it,
that's harder, and it probably is true that existing compilers don't
do it, for the same reason that most C and Fortran compilers don't:
in the general case, it's hard.
-- 
Welcome to Mars!  Your         |     Henry Spencer at U of Toronto Zoology
passport and visa, comrade?    | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list