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