F2C — The Fortran Compiler

 SYNOPSIS

 f2c [option ... ] file ...

DESCRIPTION

F2c converts Fortran 77 source code in files with names ending in `.f' or `.F' to C source files in the current directory, with `.c' substituted for the final `.f' or `.F'.

 The lcc compiler is invoked if the compilation finished without error and an object file is generated in the current directory.

If no Fortran files are named, f2c reads Fortran from standard input and writes C on standard output.

File names that end with `.p' or `.P' are taken to be prototype files, as produced by option `-P', and are read first.

  The following options have the same meaning as in other Fortran compilers.

 -C Compiles code to check that subscripts are within declared array limits

 -Idir  Looks for a non-absolute include file first in the directory of the current input file, then in directories specified by -I options (one directory per option). Options -I2 and -I4 have precedence, thus a directory named 2 should be specified by -I./2.

 -onetrip  Compiles DO loops that are performed at least once if reached. (Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.)

 -U Honors the case of variable and external names. Fortran keywords must be in lower case.

 -u Makes the default type of a variable `undefined' rather than using the default Fortran rules.

 -w Suppresses all warning messages, or if the option is `-w66', just Fortran 66 compatibility warnings.

 

 The following options are peculiar to f2c.

 -A Produces ANSI C. Default is old-style C. This option is not very useful with lcc-win32, but allows you to port the resulting C code to other machines.

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

 -C++ Outputs C++ code. This will make the resulting code incompatible with lcc-win32, and object file generation will not work. Again, this can be useful if you are porting the code to another machine or you want to link the resulting code with C++.

 -c Includes original Fortran source as comments.

 -cd Does not recognize cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for the double complex intrinsics  zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively.

 -ddir  Writes `.c' files in directory dir instead of the current directory.

 -E Declares uninitialized COMMON to be Extern (defined to be overwrite-capable in f2c.h as extern).

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

 -ext Complains about f77(1) extensions. This is useful if you want to remain compatible with Fortran 66, the standard of more than 30 years ago.

 -g Includes original Fortran line numbers in #line lines.

 -h Emulates Fortran 66's treatment of Hollerith: tries to align character strings on word (or, if the option is  `-hd', on double word) boundaries.

 -i90 Does not recognize the Fortran 90 bit-manipulation intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior,  ishft, and ishftc.

 -kr Uses temporary values to enforce Fortran expression evaluation where K&R (first edition) parenthesization  rules allow rearrangement. If the option is `-krd',  uses double precision temporaries even for single-precision operands.

 -P  Writes a file.P of ANSI (or C++) prototypes for definitions in each input file.f or file.F. When reading  Fortran from standard input, writes prototypes at the  beginning of standard output. Option -Ps implies -P  and gives exit status 4; if rerunning f2c may change  prototypes or declarations.

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

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

 -r Casts REAL arguments of intrinsic functions and values of REAL functions (including intrinsics) to REAL.

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

 -s Preserves multidimensional subscripts. Suppressed by  option `-C' .

 -Tdir  Puts temporary files in directory dir.

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

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

 -z Does not implicitly recognize DOUBLE COMPLEX.

 -!bs Does not recognize backslash escapes in character strings.

 -!c Inhibits C output, but produces -P output.

 -!I Rejects include statements.

-!i8 Disallows INTEGER*8.

 -!it  Does not infer types of untyped EXTERNAL procedures from use as parameters to previously defined or prototyped  procedures.

 -!P Does not attempt to infer ANSI or C++ prototypes from usage.

 Options specific to lcc-win32:

-removec Instructs f2c to remove the intermediate C file.

 The resulting C invokes the support routines of f77; object code should be linked with lcclnk specifying libf77.lib at the end of the command line. Wedit will automatically add this library when any of the project files end with .f.

  SEE ALSO S. I. Feldman and P. J. Weinberger, `A Portable Fortran 77 Compiler', UNIX Time Sharing System Programmer's Manual, Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990. This document is distributed with the source code of f2c. It is a file for the Laserjet printer. To print it you should open a command shell and issue the command: print f2c.prt.

 FILES

f2c.h This file is used by the generated C code. It should be in the \lcc\include directory.

libf77.lib This file is the runtime of the Fortran system. It should be in the \lcc\lib directory with all other libraries.

f2c.exe The is the compiler itself. It should be located in the \lcc\bin directory together with all other executables.

 DIAGNOSTICS

The diagnostics produced by f2c are intended to be self-explanatory. lcc-win32 will not generate any warnings when called from f2c. The resulting C file can be invalid, however, this provokes an error message from lcc-win32. This happens when you do not adhere to the prototypes given or you have an error in the calling sequence: you are calling a subroutine with different numbers of arguments within the same program. The error issued by lcc-win32 follows the warning of the Fortran compiler.

 BUGS

Floating-point constant expressions are simplified in the floating-point arithmetic of the machine running f2c, so that they are typically accurate to, at most 16 or 17, decimal places.

Untypable EXTERNAL functions are declared int.