
====== old index for f2c, now "readme from f2c" ============

FILES:

f2c.h	Include file necessary for compiling output of the converter.
	See the second NOTE below.

f2c.1	Man page for f2c.

f2c.1t	Source for f2c.1 (to be processed by troff -man or nroff -man).

libf77	Library of non I/O support routines the generated C may need.
	Fortran main programs result in a C function named MAIN__ that
	is meant to be invoked by the main() in libf77.

libi77	Library of Fortran I/O routines the generated C may need.
	Note that some vendors (e.g., BSD, Sun and MIPS) provide a
	libF77 and libI77 that are incompatible with f2c -- they
	provide some differently named routines or routines with the
	names that f2c expects, but with different calling sequences.
	On such systems, the recommended procedure is to merge
	libf77 and libi77 into a single library, say libf2c, and to
        install it where you can access it by specifying -lf2c .  The
        definition of link_msg in sysdep.c assumes this arrangement.

f2c.ps	Postscript for a technical report on f2c.  After you strip the
	mail header, the first line should be "%!PS".

fixes	The complete change log, reporting bug fixes and other changes.
	(Some recent change-log entries are given below).

fc	A shell script that uses f2c and imitates much of the behavior
	of commonly found f77 commands.  You will almost certainly
	need to adjust some of the shell-variable assignments to make
	this script work on your system.


SUBDIRECTORY:

f2c/src	Source for the converter itself, including a file of checksums
	and source for a program to compute the checksums (to verify
	correct transmission of the source), is available: ask netlib to
		send all from f2c/src
	If the checksums show damage to just a few source files, or if
	the change log file (see "fixes" below) reports corrections to
	some source files, you can request those files individually
	"from f2c/src".  For example, to get defs.h and xsum0.out, you
	would ask netlib to
		send defs.h xsum0.out from f2c/src
	"all from f2c/src" is about 640 kilobytes long; for convenience
	(and checksums), it includes copies of f2c.h, f2c.1, and f2c.1t.

	Tip: if asked to send over 99,000 bytes in one request, netlib
	breaks the shipment into 1000 line pieces and sends each piece
	separately (since otherwise some mailers might gag).  To avoid
	the hassle of reassembling the pieces, try to keep each request
	under 99,000 bytes long.  The final number in each line of
	xsum0.out gives the length of each file in f2c/src.  For
	example,
		send exec.c expr.c from f2c/src
		send format.c format_data.c from f2c/src
	will give you slightly less hassle than
		send exec.c expr.c format.c format_data.c from f2c/src
	Alternatively, if all the mailers in your return path allow
	long messages, you can supply an appropriate mailsize line in
	your netlib request, e.g.
		mailsize 200k
		send exec.c expr.c format.c format_data.c from f2c/src

	If you have trouble generating gram.c, you can ask netlib to
		send gram.c from f2c/src
	Then `xsum gram.c` should report
		gram.c	d1ac784	57350

NOTE:	For now, you may exercise f2c by sending netlib a message whose
	first line is "execute f2c" and whose remaining lines are
	the Fortran 77 source that you wish to have converted.
	Return mail brings you the resulting C, with f2c's error
	messages between #ifdef uNdEfInEd and #endif at the end.
	(To understand line numbers in the error messages, regard
	the "execute f2c" line as line 0.  It is stripped away by
	the netlib software before f2c sees your Fortran input.)
	Options described in the man page may be transmitted to
	netlib by having the first line of input be a comment
	whose first 6 characters are "c$f2c " and whose remaining
	characters are the desired options, e.g., "c$f2c -R -u".
	This scheme may change -- ask netlib to
               send index from f2c
        if you do not get the behavior you expect.

	During the initial experimental period, incoming Fortran
	will be saved in a file.  Don't send any secrets!


BUGS:	Please send bug reports (including the shortest example
	you can find that illustrates the bug) to research!dmg
	or dmg@research.att.com .  You might first check whether
	the bug goes away when you turn optimization off.


NOTE:	f2c.h defines several types, e.g., real, integer, doublereal.
	The definitions in f2c.h are suitable for most machines, but if
	your machine has sizeof(double) > 2*sizeof(long), you may need
	to adjust f2c.h appropriately.  f2c assumes
		sizeof(doublecomplex) = 2*sizeof(doublereal)
		sizeof(doublereal) = sizeof(complex)
		sizeof(doublereal) = 2*sizeof(real)
		sizeof(real) = sizeof(integer)
		sizeof(real) = sizeof(logical)
		sizeof(real) = 2*sizeof(shortint)
	EQUIVALENCEs may not be translated correctly if these
	assumptions are violated.

	There exists a C compiler that objects to the lines
		typedef VOID C_f;	/* complex function */
		typedef VOID H_f;	/* character function */
		typedef VOID Z_f;	/* double complex function */
	in f2c.h .  If yours is such a compiler, do two things:
	1. Complain to your vendor about this compiler bug.
	2. Find the line
		#define VOID void
	   in f2c.h and change it to
		#define VOID int
	(For readability, the f2c.h lines shown above have had two
	tabs inserted before their first character.)

FTP:	All the material described above is now available by anonymous
	ftp from netlib.att.com (login: anonymous; Password: your E-mail
	address; cd netlib/f2c).  Note that you can say, e.g.,

		cd /netlib/f2c/src
		binary
		prompt
		mget *.Z

	to get all the .Z files in src.  You must uncompress the .Z
	files once you have a copy of them, e.g., by

		uncompress *.Z

	Subdirectory msdos contains two PC versions of f2c,
	f2c.exe.Z and f2cx.exe.Z; the latter uses extended memory.
	The README in that directory provides more details.

-----------------
Recent change log (partial)
-----------------

Thu Sep  9 08:51:21 EDT 1993
  Adjust "include" to interpret file names relative to the directory
of the file that contains the "include".

Fri Sep 24 00:56:12 EDT 1993
  Fix offset error resulting from repeating the same equivalence
statement twice.  Example:
	real a(2), b(2)
	equivalence (a(2), b(2))
	equivalence (a(2), b(2))
	end
  Increase MAXTOKENLEN (to roughly the largest allowed by ANSI C).

Mon Sep 27 08:55:09 EDT 1993
  libi77: endfile.c: protect #include "sys/types.h" with
#ifndef NON_UNIX_STDIO; Version.c not changed.

Fri Oct 15 15:37:26 EDT 1993
  Fix rarely seen parsing bug illustrated by
	subroutine foo(xabcdefghij)
	character*(*) xabcdefghij
               IF (xabcdefghij.NE.'##') GOTO 40
 40	end
in which the spacing in the IF line is crucial.

Thu Oct 21 13:55:11 EDT 1993
  Give more meaningful error message (then "unexpected character in
cds") when constant simplification leads to Infinity or NaN.

Wed Nov 10 15:01:05 EST 1993
  libi77: backspace.c: adjust, under -DMSDOS, to cope with MSDOS
text files, as handled by some popular PC C compilers.  Beware:
the (defective) libraries associated with these compilers assume lines
end with \r\n (conventional MS-DOS text files) -- and ftell (and
hence the current implementation of backspace) screws up if lines with
just \n.

Thu Nov 18 09:37:47 EST 1993
  Give a better error (than "control stack empty") for an extraneous
ENDDO.  Example:
	enddo
	end
  Update comments about ftp in "readme from f2c".

Sun Nov 28 17:26:50 EST 1993
  Change format of time stamp in version.c to yyyymmdd.
  Sort parameter adjustments (or complain of impossible dependencies)
so that dummy arguments are referenced only after being adjusted.
Example:
	subroutine foo(a,b)
	integer a(2)		! a must be adjusted before b
	double precision b(a(1),a(2))
	call goo(b(3,4))
	end
  Adjust structs for initialized common blocks and equivalence classes
to omit the trailing struct component added to force alignment when
padding already forces the desired alignment.  Example:
	PROGRAM TEST
	COMMON /Z/ A, CC
	CHARACTER*4 CC
	DATA cc /'a'/
	END
now gives
	struct {
	    integer fill_1[1];
	    char e_2[4];
	    } z_ = { {0}, {'a', ' ', ' ', ' '} };
rather than
struct {
    integer fill_1[1];
    char e_2[4];
    real e_3;
    } z_ = { {0}, {'a', ' ', ' ', ' '}, (float)0. };

Wed Dec  8 16:24:43 EST 1993
  Adjust lex.c to recognize # nnn "filename" lines emitted by cpp;
this affects the file names and line numbers in error messages and
the #line lines emitted under -g.
  Under -g, arrange for a file that starts with an executable
statement to have the first #line line indicate line 1, rather
than the line number of the END statement ending the main program.
  Adjust fc script to run files ending in .F through /lib/cpp.
  Fix bug ("Impossible tag 2") in
	if (t .eq. (0,2)) write(*,*) 'Bug!'
	end
  libi77: iio.c: adjust internal formatted reads to treat short records
as though padded with blanks (rather than causing an "off end of record"
error).

Wed Dec 15 15:19:15 EST 1993
  fc: adjusted for .F files to pass -D and -I options to cpp.

Fri Dec 17 20:03:38 EST 1993
  Fix botch introduced 28 Nov. 1993 in vax.c; change "version of"
to "version".

Tue Jan  4 15:39:52 EST 1994
  msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only).

Wed Jan 19 08:55:19 EST 1994
  Arrange to accept
	integer	Nx, Ny, Nz
	parameter	(Nx = 10, Ny = 20)
	parameter	(Nz = max(Nx, Ny))
	integer	c(Nz)
	call foo(c)
	end
rather than complaining "Declaration error for c: adjustable dimension
on non-argument".  The necessary changes cause some hitherto unfolded
constant expressions to be folded.
  Accept BYTE as a synonym for INTEGER*1.

Thu Jan 27 08:57:40 EST 1994
  Fix botch in changes of 19 Jan. 1994 that broke entry points with
multi-dimensional array arguments that did not appear in the subprogram
argument list and whose leading dimensions depend on arguments.

Mon Feb  7 09:24:30 EST 1994
  Remove artifact in "fc" script that caused -O to be ignored:
	87c87
	<		# lcc ignores -O...
	---
	>		CFLAGS="$CFLAGS $O"

Sun Feb 20 17:04:58 EST 1994
  Fix bugs reading .P files for routines with arguments of type
INTEGER*1, INTEGER*8, LOGICAL*2.
  Fix glitch in reporting inconsistent arguments for routines involving
character arguments:  "arg n" had n too large by the number of
character arguments.

Tue Feb 22 20:50:08 EST 1994
  Trivial changes to data.c format.c main.c niceprintf.c output.h and
sysdep.h (consistency improvements).
  libI77: lread.c: check for NULL return from realloc.

Fri Feb 25 23:56:08 EST 1994
  output.c, sysdep.h: arrange for -DUSE_DTOA to use dtoa.c and g_fmt.c
for correctly rounded decimal values on IEEE-arithmetic machines
(plus machines with VAX and IBM-mainframe arithmetic).  These
routines are available from netlib's fp directory.
  msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only); the
former uses -DUSE_DTOA to keep 12 from printing as 12.000000000000001.
  vax.c: fix wrong arguments to badtag and frchain introduced
28 Nov. 1993.
  Source for f2c converted to ANSI/ISO format, with the K&R format
available by compilation with -DKR_headers .
  Arrange for (double precision expression) relop (single precision
constant) to retain the single-precision nature of the constant.
Example:
	double precision t
	if (t .eq. 0.3) ...

Mon Feb 28 11:40:24 EST 1994
  README updated to reflect a modification just made to netlib's
"dtoa.c from fp":
96a97,105
> Also add the rule
>
> 	dtoa.o: dtoa.c
> 		$(CC) -c $(CFLAGS) -DMALLOC=ckalloc -DIEEE... dtoa.c
>
> (without the initial tab) to the makefile, where IEEE... is one of
> IEEE_MC68k, IEEE_8087, VAX, or IBM, depending on your machine's
> arithmetic.  See the comments near the start of dtoa.c.
>

Sat Mar  5 09:41:52 EST 1994
  Complain about functions with the name of a previously declared
common block (which is illegal).
  New option -d specifies the directory for output .c and .P files;
f2c.1 and f2c.1t updated.  The former undocumented debug option -dnnn
is now -Dnnn.

Thu Mar 10 10:21:44 EST 1994
  libf77: add #undef min and #undef max lines to s_paus.c s_stop.c
and system_.c; Version.c not changed.
  libi77: add -DPad_UDread lines to uio.c and explanation to README:
    Some buggy Fortran programs use unformatted direct I/O to write
    an incomplete record and later read more from that record than
    they have written.  For records other than the last, the unwritten
    portion of the record reads as binary zeros.  The last record is
    a special case: attempting to read more from it than was written
    gives end-of-file -- which may help one find a bug.  Some other
    Fortran I/O libraries treat the last record no differently than
    others and thus give no help in finding the bug of reading more
    than was written.  If you wish to have this behavior, compile
    uio.c with -DPad_UDread .
Version.c not changed.

Tue Mar 29 09:26:31 EST 1994
  Adjust make_param so dimensions involving min, max, and other
complicated constant expressions do not provoke error messages
about adjustable dimensions on non-arguments.

Current timestamps of files in "all from f2c/src", sorted by time,
appear below (mm/dd/year hh:mm:ss).  To bring your source up to date,
obtain source files with a timestamp later than the time shown in your
version.c.  Note that the time shown in the current version.c is the
timestamp of the source module that immediately follows version.c below:

 3/29/1994   9:26:23  xsum0.out
 3/29/1994   8:33:07  version.c
 3/29/1994   8:32:59  data.c
 3/05/1994   2:02:49  f2c.1
 3/05/1994   2:02:42  f2c.1t
 3/05/1994   1:05:18  main.c
 3/05/1994   0:57:28  sysdep.c
 3/05/1994   0:56:34  names.c
 3/05/1994   0:49:54  defs.h
 3/05/1994   0:00:03  proc.c
 3/04/1994  23:58:15  misc.c
 3/04/1994  23:42:15  pread.c
 2/28/1994  11:32:36  README
 2/26/1994  12:18:59  makefile
 2/25/1994  23:52:00  expr.c
 2/25/1994  22:18:14  xsum.c
 2/25/1994  14:16:00  Notice
 2/25/1994  12:31:15  parse_args.c
 2/25/1994  12:18:21  format.c
 2/25/1994  12:18:21  lex.c
 2/25/1994  11:01:20  niceprintf.c
 2/25/1994  10:56:33  error.c
 2/25/1994  10:25:21  gram.head
 2/25/1994  10:24:56  vax.c
 2/25/1994  10:24:56  putpcc.c
 2/25/1994  10:24:56  put.c
 2/25/1994  10:24:55  output.c
 2/25/1994  10:24:55  p1output.c
 2/25/1994  10:24:54  formatdata.c
 2/25/1994  10:24:54  malloc.c
 2/25/1994  10:24:54  io.c
 2/25/1994  10:24:54  mem.c
 2/25/1994  10:24:54  intr.c
 2/25/1994  10:24:54  init.c
 2/25/1994  10:24:53  exec.c
 2/25/1994  10:24:53  equiv.c
 2/25/1994  10:24:52  cds.c
 2/25/1994   2:07:19  parse.h
 2/24/1994  23:24:21  sysdep.h
 2/22/1994  19:07:20  iob.h
 2/22/1994  18:56:53  p1defs.h
 2/22/1994  18:53:46  output.h
 2/22/1994  18:51:14  names.h
 2/22/1994  18:30:41  format.h
 1/18/1994  18:12:52  tokens
 1/18/1994  18:12:52  gram.dcl
 6/01/1993  23:10:00  f2c.h
 3/06/1993  14:13:58  gram.expr
 3/04/1993  14:59:25  gram.exec
 1/28/1993   9:03:16  ftypes.h
 1/25/1993  11:26:33  defines.h
 4/06/1990   0:00:57  gram.io
 2/03/1990   0:58:26  niceprintf.h
 1/29/1990  13:26:52  memset.c
 1/07/1990   1:20:01  usignal.h
11/27/1989   8:27:37  machdefs.h
 7/01/1989  11:59:44  pccdefs.h
