Fortran to C translator

Daniel R. Levy levy at ttrdc.UUCP
Thu Jun 13 15:37:48 AEST 1985


There have now been some postings on the net in reply to this question that
have pointed out that the Unix f77 compiler does not produce C code anywhere
in its action, which is true.  However, even if it did, I am sure the code
would be just as bug-ridden as what f77 produces presently in the executable.
(In a following article I have a few flames on the subject.)

I have heard of a Fortran to C translator, but never had a chance to try it.
It was advertised several months ago in Electronic Design News, or one of the
other advertisement-laden 'freebie' EE publications.  I can't seem to dig it
up right now, but I'm sure I saw it.

My impression (and I could be mistaken) is that it would be of limited value 
over f77 itself, if f77 were bug free (unfortunately, it isn't).  The calling
conventions of Fortran (variables passed to subroutines/functions are done so
by address, necessitating lots of indirect memory references in the routines
when these variables are used) and the need for the special types of I/O,
among other vagaries of Fortran, would handicap the result.  If there was a 
burning need to modify the source code anyway, it might be better just to 
hand-translate the algorithm into C, taking advantage of the greater powers 
of C.   I imagine that a Fortran to C translator would make it easier if the 
code were to be used in bulk, and it would let the code be put on most any Unix 
machine, letting cc worry about the exact machine code involved,  IF the trans-
lator were perfect or near so; it would be a great headache to have to debug the
C code because a particular C compiler didn't like it.  It would be quite a 
challenge to put out C code portable across absolutely ALL compilers.

D. Levy
AT&T Teletype Corp.
Skokie, Ill.



More information about the Comp.lang.c mailing list