|
|
1.1 ! root 1: . \" Definitions of F, L and LR for the benefit of systems ! 2: . \" whose -man lacks them... ! 3: .de F ! 4: .nh ! 5: .if n \%\&\\$1 ! 6: .if t \%\&\f(CW\\$1\fR ! 7: .hy 14 ! 8: .. ! 9: .de L ! 10: .nh ! 11: .if n \%`\\$1' ! 12: .if t \%\&\f(CW\\$1\fR ! 13: .hy 14 ! 14: .. ! 15: .de LR ! 16: .nh ! 17: .if n \%`\\$1'\\$2 ! 18: .if t \%\&\f(CW\\$1\fR\\$2 ! 19: .hy 14 ! 20: .. ! 21: .TH F2C 1 ! 22: .CT 1 prog_other ! 23: .SH NAME ! 24: f\^2c \(mi Convert Fortran 77 to C or C++ ! 25: .SH SYNOPSIS ! 26: .B f\^2c ! 27: [ ! 28: .I option ... ! 29: ] ! 30: .I file ... ! 31: .SH DESCRIPTION ! 32: .I F2c ! 33: converts Fortran 77 source code in ! 34: .I files ! 35: with names ending in ! 36: .L .f ! 37: or ! 38: .L .F ! 39: to C (or C++) source files in the ! 40: current directory, with ! 41: .L .c ! 42: substituted ! 43: for the final ! 44: .L .f ! 45: or ! 46: .LR .F . ! 47: If no Fortran files are named, ! 48: .I f\^2c ! 49: reads Fortran from standard input and ! 50: writes C on standard output. ! 51: .I File ! 52: names that end with ! 53: .L .p ! 54: or ! 55: .L .P ! 56: are taken to be prototype ! 57: files, as produced by option ! 58: .LR -P , ! 59: and are read first. ! 60: .PP ! 61: The following options have the same meaning as in ! 62: .IR f\^77 (1). ! 63: .TP ! 64: .B -C ! 65: Compile code to check that subscripts are within declared array bounds. ! 66: .TP ! 67: .B -I2 ! 68: Render INTEGER and LOGICAL as short, ! 69: INTEGER\(**4 as long int. Assume the default \fIlibF77\fR ! 70: and \fIlibI77\fR: allow only INTEGER\(**4 (and no LOGICAL) ! 71: variables in INQUIREs. Option ! 72: .L -I4 ! 73: confirms the default rendering of INTEGER as long int. ! 74: .TP ! 75: .B -onetrip ! 76: Compile DO loops that are performed at least once if reached. ! 77: (Fortran 77 DO loops are not performed at all if the upper limit is smaller than the lower limit.) ! 78: .TP ! 79: .B -U ! 80: Honor the case of variable and external names. Fortran keywords must be in ! 81: .I ! 82: lower ! 83: case. ! 84: .TP ! 85: .B -u ! 86: Make the default type of a variable `undefined' rather than using the default Fortran rules. ! 87: .TP ! 88: .B -w ! 89: Suppress all warning messages. ! 90: If the option is ! 91: .LR -w66 , ! 92: only Fortran 66 compatibility warnings are suppressed. ! 93: .PP ! 94: The following options are peculiar to ! 95: .IR f\^2c . ! 96: .TP ! 97: .B -A ! 98: Produce ! 99: .SM ANSI ! 100: C. ! 101: Default is old-style C. ! 102: .TP ! 103: .B -a ! 104: Make local variables automatic rather than static ! 105: unless they appear in a ! 106: .SM "DATA, EQUIVALENCE, NAMELIST," ! 107: or ! 108: .SM SAVE ! 109: statement. ! 110: .TP ! 111: .B -C++ ! 112: Output C++ code. ! 113: .TP ! 114: .B -c ! 115: Include original Fortran source as comments. ! 116: .TP ! 117: .B -E ! 118: Declare uninitialized ! 119: .SM COMMON ! 120: to be ! 121: .B Extern ! 122: (overridably defined in ! 123: .F f2c.h ! 124: as ! 125: .B extern). ! 126: .TP ! 127: .B -ec ! 128: Place uninitialized ! 129: .SM COMMON ! 130: blocks in separate files: ! 131: .B COMMON /ABC/ ! 132: appears in file ! 133: .BR abc_com.c . ! 134: Option ! 135: .LR -e1c ! 136: bundles the separate files ! 137: into the output file, with comments that give an unbundling ! 138: .IR sed (1) ! 139: script. ! 140: .TP ! 141: .B -ext ! 142: Complain about ! 143: .IR f\^77 (1) ! 144: extensions. ! 145: .TP ! 146: .B -f ! 147: Assume free-format input: accept text after column 72 and do not ! 148: pad lines shorter than 72 characters with blanks. ! 149: .TP ! 150: .B -72 ! 151: Treat text appearing after column 72 as an error. ! 152: .TP ! 153: .B -g ! 154: Include original Fortran line numbers in \f(CW#line\fR lines. ! 155: .TP ! 156: .B -h ! 157: Try to align character strings on word (or, if the option is ! 158: .LR -hd , ! 159: on double-word) boundaries. ! 160: .TP ! 161: .B -i2 ! 162: Similar to ! 163: .BR -I2 , ! 164: but assume a modified ! 165: .I libF77 ! 166: and ! 167: .I libI77 ! 168: (compiled with ! 169: .BR -Df\^2c_i2 ), ! 170: so ! 171: .SM INTEGER ! 172: and ! 173: .SM LOGICAL ! 174: variables may be assigned by ! 175: .SM INQUIRE ! 176: and array lengths are stored in short ints. ! 177: .TP ! 178: .B -kr ! 179: Use temporary values to enforce Fortran expression evaluation ! 180: where K&R (first edition) parenthesization rules allow rearrangement. ! 181: If the option is ! 182: .LR -krd , ! 183: use double precision temporaries even for single-precision operands. ! 184: .TP ! 185: .B -P ! 186: Write a ! 187: .IB file .P ! 188: of ANSI (or C++) prototypes ! 189: for procedures defined in each input ! 190: .IB file .f ! 191: or ! 192: .IB file .F . ! 193: When reading Fortran from standard input, write prototypes ! 194: at the beginning of standard output. ! 195: Implies ! 196: .B -A ! 197: unless option ! 198: .L -C++ ! 199: is present. Option ! 200: .B -Ps ! 201: implies ! 202: .B -P , ! 203: and gives exit status 4 if rerunning ! 204: .I f\^2c ! 205: may change prototypes or declarations. ! 206: .TP ! 207: .B -p ! 208: Supply preprocessor definitions to make common-block members ! 209: look like local variables. ! 210: .TP ! 211: .B -R ! 212: Do not promote ! 213: .SM REAL ! 214: functions and operations to ! 215: .SM DOUBLE PRECISION. ! 216: Option ! 217: .L -!R ! 218: confirms the default, which imitates ! 219: .IR f\^77 . ! 220: .TP ! 221: .B -r ! 222: Cast values of REAL functions (including intrinsics) to REAL. ! 223: .TP ! 224: .B -r8 ! 225: Promote ! 226: .SM REAL ! 227: to ! 228: .SM DOUBLE PRECISION, COMPLEX ! 229: to ! 230: .SM DOUBLE COMPLEX. ! 231: .TP ! 232: .BI -T dir ! 233: Put temporary files in directory ! 234: .I dir. ! 235: .TP ! 236: .B -w8 ! 237: Suppress warnings when ! 238: .SM COMMON ! 239: or ! 240: .SM EQUIVALENCE ! 241: forces odd-word alignment of doubles. ! 242: .TP ! 243: .BI -W n ! 244: Assume ! 245: .I n ! 246: characters/word (default 4) ! 247: when initializing numeric variables with character data. ! 248: .TP ! 249: .B -z ! 250: Do not implicitly recognize ! 251: .SM DOUBLE COMPLEX. ! 252: .TP ! 253: .B -!bs ! 254: Do not recognize \fIb\fRack\fIs\fRlash escapes ! 255: (\e", \e', \e0, \e\e, \eb, \ef, \en, \er, \et, \ev) in character strings. ! 256: .TP ! 257: .B -!c ! 258: Inhibit C output, but produce ! 259: .B -P ! 260: output. ! 261: .TP ! 262: .B -!I ! 263: Reject ! 264: .B include ! 265: statements. ! 266: .TP ! 267: .B -!it ! 268: Don't infer types of untyped ! 269: .SM EXTERNAL ! 270: procedures from use as parameters to previously defined or prototyped ! 271: procedures. ! 272: .TP ! 273: .B -!P ! 274: Do not attempt to infer ! 275: .SM ANSI ! 276: or C++ ! 277: prototypes from usage. ! 278: .PP ! 279: The resulting C invokes the support routines of ! 280: .IR f\^77 ; ! 281: object code should be loaded by ! 282: .I f\^77 ! 283: or with ! 284: .IR ld (1) ! 285: or ! 286: .IR cc (1) ! 287: options ! 288: .BR "-lF77 -lI77 -lm" . ! 289: Calling conventions ! 290: are those of ! 291: .IR f\&77 : ! 292: see the reference below. ! 293: .br ! 294: .SH FILES ! 295: .TP ! 296: .IB file .[fF] ! 297: input file ! 298: .TP ! 299: .B *.c ! 300: output file ! 301: .TP ! 302: .F /usr/include/f2c.h ! 303: header file ! 304: .TP ! 305: .F /usr/lib/libF77.a ! 306: intrinsic function library ! 307: .TP ! 308: .F /usr/lib/libI77.a ! 309: Fortran I/O library ! 310: .TP ! 311: .F /lib/libc.a ! 312: C library, see section 3 ! 313: .SH "SEE ALSO" ! 314: S. I. Feldman and ! 315: P. J. Weinberger, ! 316: `A Portable Fortran 77 Compiler', ! 317: \fIUNIX Time Sharing System Programmer's Manual\fR, ! 318: Tenth Edition, Volume 2, AT&T Bell Laboratories, 1990. ! 319: .SH DIAGNOSTICS ! 320: The diagnostics produced by ! 321: .I f\^2c ! 322: are intended to be ! 323: self-explanatory. ! 324: .SH BUGS ! 325: Floating-point constant expressions are simplified in ! 326: the floating-point arithmetic of the machine running ! 327: .IR f\^2c , ! 328: so they are typically accurate to at most 16 or 17 decimal places. ! 329: .br ! 330: Untypable ! 331: .SM EXTERNAL ! 332: functions are declared ! 333: .BR int .
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.