2 ====== index for f2c ============
6 f2c.h Include file necessary for compiling output of the converter.
7 See the second NOTE below.
9 f2c.1 Man page for f2c.
11 f2c.1t Source for f2c.1 (to be processed by troff -man or nroff -man).
13 libf77 Library of non I/O support routines the generated C may need.
14 Fortran main programs result in a C function named MAIN__ that
15 is meant to be invoked by the main() in libf77.
17 libi77 Library of Fortran I/O routines the generated C may need.
18 Note that some vendors (e.g., BSD, Sun and MIPS) provide a
19 libF77 and libI77 that are incompatible with f2c -- they
20 provide some differently named routines or routines with the
21 names that f2c expects, but with different calling sequences.
22 On such systems, the recommended procedure is to merge
23 libf77 and libi77 into a single library, say libf2c, to install
24 it where you can access it by specifying -lf2c , and to adjust
25 the definition of link_msg in sysdep.c appropriately.
27 f2c.ps Postscript for a technical report on f2c. After you strip the
28 mail header, the first line should be "%!PS".
30 fixes The complete change log, reporting bug fixes and other changes.
31 (Some recent change-log entries are given below).
33 fc A shell script that uses f2c and imitates much of the behavior
34 of commonly found f77 commands. You will almost certainly
35 need to adjust some of the shell-variable assignments to make
36 this script work on your system.
41 f2c/src Source for the converter itself, including a file of checksums
42 and source for a program to compute the checksums (to verify
43 correct transmission of the source), is available: ask netlib to
45 If the checksums show damage to just a few source files, or if
46 the change log file (see "fixes" below) reports corrections to
47 some source files, you can request those files individually
48 "from f2c/src". For example, to get defs.h and xsum0.out, you
50 send defs.h xsum0.out from f2c/src
51 "all from f2c/src" is 649642 bytes long.
53 Tip: if asked to send over 99,000 bytes in one request, netlib
54 breaks the shipment into 1000 line pieces and sends each piece
55 separately (since otherwise some mailers might gag). To avoid
56 the hassle of reassembling the pieces, try to keep each request
57 under 99,000 bytes long. The final number in each line of
58 xsum0.out gives the length of each file in f2c/src. For
60 send exec.c expr.c from f2c/src
61 send format.c format_data.c from f2c/src
62 will give you slightly less hassle than
63 send exec.c expr.c format.c format_data.c from f2c/src
65 If you have trouble generating gram.c, you can ask netlib to
66 send gram.c from f2c/src
67 Then `xsum gram.c` should report
70 NOTE: For now, you may exercise f2c by sending netlib a message whose
71 first line is "execute f2c" and whose remaining lines are
72 the Fortran 77 source that you wish to have converted.
73 Return mail brings you the resulting C, with f2c's error
74 messages between #ifdef uNdEfInEd and #endif at the end.
75 (To understand line numbers in the error messages, regard
76 the "execute f2c" line as line 0. It is stripped away by
77 the netlib software before f2c sees your Fortran input.)
78 Options described in the man page may be transmitted to
79 netlib by having the first line of input be a comment
80 whose first 6 characters are "c$f2c " and whose remaining
81 characters are the desired options, e.g., "c$f2c -R -u".
82 This scheme may change -- ask netlib to
84 if you do not get the behavior you expect.
86 During the initial experimental period, incoming Fortran
87 will be saved in a file. Don't send any secrets!
90 BUGS: Please send bug reports (including the shortest example
91 you can find that illustrates the bug) to research!dmg
92 or dmg@research.att.com . You might first check whether
93 the bug goes away when you turn optimization off.
96 NOTE: f2c.h defines several types, e.g., real, integer, doublereal.
97 The definitions in f2c.h are suitable for most machines, but if
98 your machine has sizeof(double) > 2*sizeof(long), you may need
99 to adjust f2c.h appropriately. f2c assumes
100 sizeof(doublecomplex) = 2*sizeof(doublereal)
101 sizeof(doublereal) = sizeof(complex)
102 sizeof(doublereal) = 2*sizeof(real)
103 sizeof(real) = sizeof(integer)
104 sizeof(real) = sizeof(logical)
105 sizeof(real) = 2*sizeof(shortint)
106 EQUIVALENCEs may not be translated correctly if these
107 assumptions are violated.
109 There exists a C compiler that objects to the lines
110 typedef VOID C_f; /* complex function */
111 typedef VOID H_f; /* character function */
112 typedef VOID Z_f; /* double complex function */
113 in f2c.h . If yours is such a compiler, do two things:
114 1. Complain to your vendor about this compiler bug.
117 in f2c.h and change it to
119 (For readability, the f2c.h lines shown above have had two
120 tabs inserted before their first character.)
122 FTP: All the material described above is now available by ftp from
123 research.att.com (login: netlib; Password: your E-mail address;
124 cd f2c). You must uncompress the .Z files once you have a
125 copy of them, e.g., by
129 Recent change log (partial)
132 Tue Jan 15 12:00:24 EST 1991:
133 Fix bug when two equivalence groups are merged, the second with
134 nonzero offset, and the result is then merged into a common block.
136 INTEGER W(3), X(3), Y(3), Z(3)
138 EQUIVALENCE (W(1),X(1)), (X(2),Y(1)), (Z(3),X(1))
139 ***** W WAS GIVEN THE WRONG OFFSET
140 Recognize Fortran 90's optional NML= in NAMELIST READs and WRITEs.
141 (Currently NML= and FMT= are treated as synonyms -- there's no
142 error message if, e.g., NML= specifies a format.)
143 libi77: minor adjustment to allow internal READs from character
144 string constants in read-only memory.
146 Wed Jan 23 00:38:48 EST 1991:
147 Allow hex, octal, and binary constants to have the qualifying letter
148 (z, x, o, or b) either before or after the quoted string containing the
149 digits. For now this change will not be reflected in f2c.ps .
151 Tue Jan 29 16:23:45 EST 1991:
152 Arrange for character-valued statement functions to give results of
153 the right length (that of the statement function's name).
155 Wed Jan 30 07:05:32 EST 1991:
156 More tweaks for character-valued statement functions: an error
157 check and an adjustment so a right-hand side of nonconstant length
158 (e.g., a substring) is handled right.
160 Thu Jan 31 13:53:44 EST 1991:
161 Add a test after the cleanup call generated for I/O statements with
162 ERR= or END= clauses to catch the unlikely event that the cleanup
163 routine encounters an error.
165 Tue Feb 5 01:39:36 EST 1991:
166 Change Mktemp to mktmp (for the benefit of systems so brain-damaged
167 that they do not distinguish case in external names -- and that for
168 some reason want to load mktemp). Try to get xsum0.out right this
169 time (it somehow didn't get updated on 4 Feb. 1991).
170 Add note to libi77/README about adjusting the interpretation of
171 RECL= specifiers in OPENs for direct unformatted I/O.
173 Thu Feb 7 17:24:42 EST 1991:
174 New option -r casts values of REAL functions, including intrinsics,
175 to REAL. This only matters for unportable code like
178 if (r .eq. asin(1.)) ...
179 [The behavior of such code varies with the Fortran compiler used --
180 and sometimes is affected by compiler options.] For now, the man page
181 at the end of f2c.ps is the only part of f2c.ps that reflects this new
184 Fri Feb 8 18:12:51 EST 1991:
185 Cast pointer differences passed as arguments to the appropriate type.
186 This matters, e.g., with MSDOS compilers that yield a long pointer
187 difference but have int == short.
188 Disallow nonpositive dimensions.
190 Fri Feb 15 12:24:15 EST 1991:
191 Change %d to %ld in sprintf call in putpower in putpcc.c.
192 Free more memory (e.g. allowing translation of larger Fortran
194 Recognize READ (character expression)
195 as formatted I/O with the format given by the character expression.
196 Update year in Notice.
198 Mon Mar 4 15:19:42 EST 1991:
199 Fix bug in passing the real part of a complex argument to an intrinsic
200 function. Omit unneeded parentheses in nested calls to intrinsics.
204 x = exp(sin(real(y))) + exp(imag(y))
207 Fri Mar 8 15:05:42 EST 1991:
208 Fix a comment in expr.c; omit safstrncpy.c (which had bugs in
209 cases not used by f2c).
211 Wed Mar 13 02:27:23 EST 1991:
212 Initialize firstmemblock->next in mem_init in mem.c . [On most
213 systems it was fortuituously 0, but with System V, -lmalloc could
214 trip on this missed initialization.]
216 Wed Mar 13 11:47:42 EST 1991:
217 Fix a reference to freed memory.
219 Wed Mar 27 00:42:19 EST 1991:
220 Fix a memory fault caused by such illegal Fortran as
223 logical foo ! declaration among executables
224 foo=.false. ! used to suffer memory fault
227 Fri Apr 5 08:30:31 EST 1991:
228 Fix loss of % in some format expressions, e.g.
230 Fix botch introduced 27 March 1991 that caused subroutines with
231 multiple entry points to have extraneous declarations of ret_val.
233 Fri Apr 5 12:44:02 EST 1991
234 Try again to omit extraneous ret_val declarations -- this morning's
235 fix was sometimes wrong.
237 Mon Apr 8 13:47:06 EDT 1991:
238 Arrange for s_rnge to have the right prototype under -A -C .
240 Wed Apr 17 13:36:03 EDT 1991:
241 New fatal error message for apparent invocation of a recursive
244 Thu Apr 25 15:13:37 EDT 1991:
245 F2c and libi77 adjusted so NAMELIST works with -i2. (I forgot
246 about -i2 when adding NAMELIST.) This required a change to f2c.h
247 (that only affects NAMELIST I/O under -i2.) Man-page description of
248 -i2 adjusted to reflect that -i2 stores array lengths in short ints.
250 Fri Apr 26 02:54:41 EDT 1991:
251 Libi77: fix some bugs in NAMELIST reading of multi-dimensional arrays
254 Tue May 7 09:04:48 EDT 1991:
255 gram.c added to f2c/src (for folks who have trouble generating it. It
256 is not in "all from f2c", nor in the list of current timestamps below.)
258 Thu May 9 02:13:51 EDT 1991:
259 Omit a trailing space in expr.c (could cause a false xsum value if
260 a mailer drops the trailing blank).
262 Thu May 16 13:14:59 EDT 1991:
263 libi77: increase LEFBL in lio.h to overcome a NeXT bug.
264 Tweak for compilers that recognize "nested" comments: inside comments,
265 turn /* into /+ (as well as */ into +/).
267 Sat May 25 11:44:25 EDT 1991:
268 libf77: s_rnge: declare line long int rather than int.
270 Fri May 31 07:51:50 EDT 1991:
271 libf77: system_: officially return status.
273 Mon Jun 17 16:52:53 EDT 1991:
274 Minor tweaks: omit unnecessary declaration of strcmp (that caused
275 trouble on a system where strcmp was a macro) from misc.c; add
276 SHELL = /bin/sh to makefiles.
277 Fix a dereference of null when a CHARACTER*(*) declaration appears
278 (illegally) after DATA. Complain only once per subroutine about
279 declarations appearing after DATA.
281 Mon Jul 1 00:28:13 EDT 1991:
282 Add test and error message for illegal use of subroutine names, e.g.
287 Mon Jul 8 21:49:20 EDT 1991:
288 Issue a warning about things like
291 (which is treated as i = ichar('a')). [It might be nice to treat 'abc'
292 as an integer initialized (in a DATA statement) with 'abc', but
293 other matters have higher priority.]
300 (which assumes ASCII).
302 Fri Jul 12 07:41:30 EDT 1991:
303 Note added to README about erroneous definitions of __STDC__ .
305 Sat Jul 13 13:38:54 EDT 1991:
306 Fix bugs in double type convesions of complex values, e.g.
307 sngl(real(...)) or dble(real(...)) (where ... is complex).
309 Mon Jul 15 13:21:42 EDT 1991:
310 Fix bug introduced 8 July 1991 that caused erroneous warnings
311 "ichar([first char. of] char. string) assumed for conversion to numeric"
312 when a subroutine had an array of character strings as an argument.
314 Wed Aug 28 01:12:17 EDT 1991:
315 Omit an unused function in format.c, an unused variable in proc.c .
316 Under -r8, promote complex to double complex (as the man page claims).
318 Fri Aug 30 17:19:17 EDT 1991:
319 f2c.ps updated: slightly expand description of intrinsics and,or,xor,
320 not; add mention of intrinsics lshift, rshift; add note about f2c
321 accepting Fortran 90 inline comments (starting with !); update Cobalt
324 Tue Sep 17 07:17:33 EDT 1991:
325 libI77: err.c and open.c modified to use modes "rb" and "wb"
326 when (f)opening unformatted files; README updated to point out
327 that it may be necessary to change these modes to "r" and "w"
328 on some non-ANSI systems.
330 Current timestamps of files in "all from f2c/src", sorted by time,
331 appear below (mm/dd/year hh:mm:ss). To bring your source up to date,
332 obtain source files with a timestamp later than the time shown in your
333 version.c. Note that the time shown in the current version.c is the
334 timestamp of the source module that immediately follows version.c below:
336 8/28/1991 0:29:01 xsum0.out
337 8/28/1991 0:23:26 version.c
338 8/28/1991 0:07:02 main.c
339 8/28/1991 0:07:01 gram.dcl
340 8/28/1991 0:07:01 expr.c
341 8/28/1991 0:07:00 defs.h
342 8/13/1991 9:06:09 format.c
343 8/13/1991 9:04:25 proc.c
344 7/13/1991 12:58:37 putpcc.c
345 7/12/1991 7:25:33 README
346 7/05/1991 7:16:57 intr.c
347 6/17/1991 16:43:01 gram.head
348 6/06/1991 0:41:56 makefile
349 6/05/1991 8:34:09 misc.c
350 5/16/1991 13:06:06 p1output.c
351 4/25/1991 13:20:26 f2c.1
352 4/25/1991 12:56:19 f2c.h
353 4/25/1991 12:51:27 f2c.1t
354 4/25/1991 12:10:22 io.c
355 4/05/1991 7:43:45 mem.c
356 3/13/1991 11:18:09 output.c
357 3/08/1991 10:14:45 niceprintf.c
358 2/15/1991 12:08:26 Notice
359 2/08/1991 11:29:18 gram.exec
360 2/08/1991 11:29:18 malloc.c
361 2/05/1991 0:52:39 exec.c
362 1/22/1991 19:25:10 lex.c
363 1/15/1991 1:21:00 equiv.c
364 12/16/1990 16:46:20 xsum.c
365 12/07/1990 17:37:08 names.c
366 11/30/1990 9:47:48 data.c
367 7/26/1990 10:54:47 parse_args.c
368 7/26/1990 10:44:26 parse.h
369 6/19/1990 0:18:23 formatdata.c
370 5/11/1990 14:17:04 error.c
371 4/23/1990 17:35:47 sysdep.h
372 4/23/1990 16:37:50 sysdep.c
373 4/18/1990 12:25:19 init.c
374 4/18/1990 12:25:19 pread.c
375 4/18/1990 12:25:18 cds.c
376 4/10/1990 0:00:38 put.c
377 4/06/1990 0:00:57 gram.io
378 4/05/1990 23:40:09 gram.expr
379 3/27/1990 16:39:18 names.h
380 3/27/1990 10:05:15 p1defs.h
381 3/27/1990 10:05:14 defines.h
382 2/25/1990 9:04:30 vax.c
383 2/16/1990 10:37:27 tokens
384 2/14/1990 2:00:20 format.h
385 2/14/1990 1:38:46 output.h
386 2/14/1990 0:54:06 iob.h
387 2/03/1990 0:58:26 niceprintf.h
388 1/29/1990 13:26:52 memset.c
389 1/11/1990 18:02:51 ftypes.h
390 1/07/1990 1:20:01 usignal.h
391 11/27/1989 8:27:37 machdefs.h
392 7/01/1989 11:59:44 pccdefs.h