F2C(1)

NAME
f2c - Convert Fortran 77 to C or C++

SYNOPSIS
f2c [ option ... ] file ...

DESCRIPTION
F2c converts Fortran 77 source code in files with names ending in or to C (or C++) source files in the current directory, with substituted for the final or If no Fortran files are named, f2c reads Fortran from standard input and writes C on standard output. File names that end with or are taken to be prototype files, as produced by option and are read first.

The options are

-w, -w66, -onetrip, -u, -C, -I2, -I4 (default), -U
Same as in f77(1).

-A  Produce ANSI C. Default is old-style C.

-a  Make local variables automatic rather than static unless they appear in a DATA, EQUIVALENCE, NAMELIST, or SAVE statement.

-C++
    Output C++ code.

-c  Include original Fortran source as comments.

-E  Declare uninitialized COMMON to be Extern (overridably defined in as extern).

-ec Place uninitialized COMMON blocks in separate files: COMMON /ABC/ appears in file abc_com.c. Option bundles the separate files into the output file, with comments that give an unbundling sed(1) script.

-ext
    Complain about f77(1) extensions.

-g  Include original Fortran line numbers as comments.

-i2 Similar to -I2, but assume a modified libF77 and libI77 (compiled with -Df2c_i2), so INTEGER and LOGICAL variables may be assigned by INQUIRE.

-P  Write a file.P of ANSI (or C++) prototypes for procedures defined in each input file.f or file.F. When reading Fortran from standard input, write prototypes at the beginning of standard output. Implies -A unless option is present. Option -Ps implies -P and gives exit status 4 if rerunning f2c may change prototypes or declarations.

-p  Supply preprocessor definitions to make common-block members look like local variables.

-R  Do not promote REAL functions and operations to DOUBLE PRECISION. Option confirms the default, which imitates f77.

-r8 Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE COMPLEX.

-Tdir
    Put temporary files in directory dir.

-w8 Suppress warnings when COMMON or EQUIVALENCE forces odd-word alignment of doubles.

-Wn Assume n characters/word (default 4) when initializing numeric variables with character data.

-z  Do not implicitly recognize DOUBLE COMPLEX.

-!c Inhibit C output, but produce -P output.

-!I Reject include statements.

-!it
    Do not infer return types of untyped EXTERNAL procedures from use as arguments.

-!P Do not infer ANSI or C++ prototypes from usage.

The resulting C invokes the support routines of f77; object code should be loaded by f77 or with ld(1) or cc(1) options -lF77 -lI77 -lm.

FILES
Other files as in f77(1).

SEE ALSO
S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77 Compiler', this manual, Volume 2.

BUGS
Floating-point constant expressions are accurate to at most 16 or 17 decimal places.