home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / fortrn2c / f2c.1 < prev    next >
Encoding:
Text File  |  1992-06-01  |  5.8 KB  |  182 lines

  1.  
  2.      F2C(1)                            F2C(1)
  3.  
  4.      NAME
  5.       f2c -    Convert    Fortran    77 to C    or C++
  6.  
  7.      SYNOPSIS
  8.       f2c [    option ... ] file ...
  9.  
  10.      DESCRIPTION
  11.       F2c converts Fortran 77 source code in files with names end-
  12.       ing in `.f' or `.F' to C (or C++) source files in the
  13.       current directory, with `.c' substituted for the final `.f'
  14.       or `.F'.  If no Fortran files    are named, f2c reads Fortran
  15.       from standard    input and writes C on standard output.    File
  16.       names    that end with `.p' or `.P' are taken to    be prototype
  17.       files, as produced by    option `-P', and are read first.
  18.  
  19.       The following    options    have the same meaning as in f77(1).
  20.  
  21.       -C   Compile code to check that subscripts are within
  22.            declared    array bounds.
  23.  
  24.       -I2  Render INTEGER and LOGICAL as short, INTEGER*4 as long
  25.            int.  Assume the    default    libF77 and libI77:  allow only
  26.            INTEGER*4 (and no LOGICAL) variables in INQUIREs.
  27.            Option `-I4' confirms the default rendering of INTEGER
  28.            as long int.
  29.  
  30.       -onetrip
  31.            Compile DO loops    that are performed at least once if
  32.            reached.     (Fortran 77 DO    loops are not performed    at all
  33.            if the upper limit is smaller than the lower limit.)
  34.  
  35.       -U   Honor the case of variable and external names.  Fortran
  36.            keywords    must be    in lower case.
  37.  
  38.       -u   Make the    default    type of    a variable `undefined' rather
  39.            than using the default Fortran rules.
  40.  
  41.       -w   Suppress    all warning messages.  If the option is
  42.            `-w66', only Fortran 66 compatibility warnings are
  43.            suppressed.
  44.  
  45.       The following    options    are peculiar to    f2c.
  46.  
  47.       -A   Produce ANSI C.    Default    is old-style C.
  48.  
  49.       -a   Make local variables automatic rather than static
  50.            unless they appear in a DATA, EQUIVALENCE, NAMELIST, or
  51.            SAVE statement.
  52.  
  53.       -C++ Output C++ code.
  54.  
  55.       -c   Include original    Fortran    source as comments.
  56.  
  57.      Page 1               Tenth Edition          (printed 2/6/91)
  58.  
  59.      F2C(1)                            F2C(1)
  60.  
  61.       -E   Declare uninitialized COMMON to be Extern (overridably
  62.            defined in f2c.h    as extern).
  63.  
  64.       -ec  Place uninitialized COMMON blocks in separate files:
  65.            COMMON /ABC/ appears in file abc_com.c.    Option `-e1c'
  66.            bundles the separate files into the output file,    with
  67.            comments    that give an unbundling    sed(1) script.
  68.  
  69.       -ext Complain    about f77(1) extensions.
  70.  
  71.       -g   Include original    Fortran    line numbers as    comments.
  72.  
  73.       -h   Try to align character strings on word (or, if the
  74.            option is `-hd',    on double-word)    boundaries.
  75.  
  76.       -i2  Similar to -I2, but assume a modified libF77 and    libI77
  77.            (compiled with -Df2c_i2), so INTEGER and    LOGICAL    vari-
  78.            ables may be assigned by    INQUIRE.
  79.  
  80.       -kr  Use temporary values to enforce Fortran expression
  81.            evaluation where    K&R (first edition) parenthesization
  82.            rules allow rearrangement.  If the option is `-krd',
  83.            use double precision temporaries    even for single-
  84.            precision operands.
  85.  
  86.       -P   Write a file.P of ANSI (or C++) prototypes for pro-
  87.            cedures defined in each input file.f or file.F.    When
  88.            reading Fortran from standard input, write prototypes
  89.            at the beginning    of standard output.  Implies -A    unless
  90.            option `-C++' is    present.  Option -Ps implies -P    , and
  91.            gives exit status 4 if rerunning    f2c may    change proto-
  92.            types or    declarations.
  93.  
  94.       -p   Supply preprocessor definitions to make common-block
  95.            members look like local variables.
  96.  
  97.       -R   Do not promote REAL functions and operations to DOUBLE
  98.            PRECISION.  Option `-!R'    confirms the default, which
  99.            imitates    f77.
  100.  
  101.       -r   Cast values of REAL functions (including    intrinsics) to
  102.            REAL.
  103.  
  104.       -r8  Promote REAL to DOUBLE PRECISION, COMPLEX to DOUBLE
  105.            COMPLEX.
  106.  
  107.       -Tdir
  108.            Put temporary files in directory    dir.
  109.  
  110.       -w8  Suppress    warnings when COMMON or    EQUIVALENCE forces
  111.            odd-word    alignment of doubles.
  112.  
  113.      Page 2               Tenth Edition          (printed 2/6/91)
  114.  
  115.      F2C(1)                            F2C(1)
  116.  
  117.       -Wn  Assume n    characters/word    (default 4) when initializing
  118.            numeric variables with character    data.
  119.  
  120.       -z   Do not implicitly recognize DOUBLE COMPLEX.
  121.  
  122.       -!bs Do not recognize    backslash escapes (\", \', \0, \\, \b,
  123.            \f, \n, \r, \t, \v) in character    strings.
  124.  
  125.       -!c  Inhibit C output, but produce -P    output.
  126.  
  127.       -!I  Reject include statements.
  128.  
  129.       -!it Don't infer types of untyped EXTERNAL procedures    from
  130.            use as parameters to previously defined or prototyped
  131.            procedures.
  132.  
  133.       -!P  Do not attempt to infer ANSI or C++ prototypes from
  134.            usage.
  135.  
  136.       The resulting    C invokes the support routines of f77; object
  137.       code should be loaded    by f77 or with ld(1) or    cc(1) options
  138.       -lF77    -lI77 -lm.  Calling conventions    are those of f77: see
  139.       the reference    below.
  140.  
  141.      FILES
  142.       file.[fF]
  143.            input file
  144.  
  145.       *.c  output file
  146.  
  147.       /usr/include/f2c.h
  148.            header file
  149.  
  150.       /usr/lib/libF77.a
  151.            intrinsic function library
  152.  
  153.       /usr/lib/libI77.a
  154.            Fortran I/O library
  155.  
  156.       /lib/libc.a
  157.            C library, see section 3
  158.  
  159.      SEE ALSO
  160.       S. I.    Feldman    and P. J. Weinberger, `A Portable Fortran 77
  161.       Compiler', UNIX Time Sharing System Programmer's Manual,
  162.       Tenth    Edition, Volume    2, AT&T    Bell Laboratories, 1990.
  163.  
  164.      DIAGNOSTICS
  165.       The diagnostics produced by f2c are intended to be self-
  166.       explanatory.
  167.  
  168.      BUGS
  169.  
  170.      Page 3               Tenth Edition          (printed 2/6/91)
  171.  
  172.      F2C(1)                            F2C(1)
  173.  
  174.       Floating-point constant expressions are simplified in    the
  175.       floating-point arithmetic of the machine running f2c,    so
  176.       they are typically accurate to at most 16 or 17 decimal
  177.       places.
  178.       Untypable EXTERNAL functions are declared int.
  179.  
  180.      Page 4               Tenth Edition          (printed 2/6/91)
  181.  
  182.