31 Aug. 1989: 1. A(min(i,j)) now is translated correctly (where A is an array). 2. 7 and 8 character variable names are allowed (but elicit a complaint under -ext). 3. LOGICAL*1 is treated as LOGICAL, with just one error message per LOGICAL*1 statement (rather than one per variable declared in that statement). [Note that LOGICAL*1 is not in Fortran 77.] Like f77, f2c now allows the format in a read or write statement to be an integer array. 5 Sept. 1989: Fixed botch in argument passing of substrings of equivalenced variables. 15 Sept. 1989: Warn about incorrect code generated when a character-valued function is not declared external and is passed as a parameter (in violation of the Fortran 77 standard) before it is invoked. Example: subroutine foo(a,b) character*10 a,b call goo(a,b) b = a(3) end 18 Sept. 1989: Complain about overlapping initializations. 20 Sept. 1989: Warn about names declared EXTERNAL but never referenced; include such names as externs in the generated C (even though most C compilers will discard them). 24 Sept. 1989: New option -w8 to suppress complaint when COMMON or EQUIVALENCE forces word alignment of a double. Under -A (for ANSI C), ensure that floating constants (terminated by 'f') contain either a decimal point or an exponent field. Repair bugs sometimes encountered with CHAR and ICHAR intrinsic functions. Restore f77's optimizations for copying and comparing character strings of length 1. Always assume floating-point valued routines in libF77 return doubles, even under -R. Repair occasional omission of arguments in routines having multiple entry points. Repair bugs in computing offsets of character strings involved in EQUIVALENCE. Don't omit structure qualification when COMMON variables are used as FORMATs or internal files. 2 Oct. 1989: Warn about variables that appear only in data stmts; don't emit them. Fix bugs in character DATA for noncharacter variables involved in EQUIVALENCE. Treat noncharacter variables initialized (at least partly) with character data as though they were equivalenced -- put out a struct and #define the variables. This eliminates the hideous and nonportable numeric values that were used to initialize such variables. Treat IMPLICIT NONE as IMPLICIT UNDEFINED(A-Z) . Quit when given invalid options. 8 Oct. 1989: Modified naming scheme for generated intermediate variables; more are recycled, fewer distinct ones used. New option -W nn specifies nn characters/word for Hollerith data initializing non-character variables. Bug fix: x(i:min(i+10,j)) used to elicit "Can't handle opcode 31 yet". Integer expressions of the form (i+const1) - (i+const2), where i is a scalar integer variable, are now simplified to (const1-const2); this leads to simpler translation of some substring expressions. Initialize uninitialized portions of character string arrays to 0 rather than to blanks. 9 Oct. 1989: New option -c to insert comments showing original Fortran source. New option -g to insert line numbers of original Fortran source. 10 Oct. 1989: ! recognized as in-line comment delimiter (a la Fortran 88). 24 Oct. 1989: New options to ease coping with systems that want the structs that result from COMMON blocks to be defined just once: -E causes uninitialized COMMON blocks to be declared Extern; if Extern is undefined, f2c.h #defines it to be extern. -ec causes a separate .c file to be emitted for each uninitialized COMMON block: COMMON /ABC/ yields abc_com.c; thus one can compile *_com.c into a library to ensure precisely one definition. -e1c is similar to -ec, except that everything goes into one file, along with comments that give a sed script for splitting the file into the pieces that -ec would give. This is for use with netlib's "execute f2c" service (for which -ec is coerced into -e1c, and the sed script will put everything but the COMMON definitions into f2c_out.c ). 28 Oct. 1989: Convert "i = i op ..." into "i op= ...;" even when i is a dummy argument. 13 Nov. 1989: Name integer constants (passed as arguments) c__... rather than c_... so common /c/stuff call foo(1) ... is translated correctly. 19 Nov. 1989: Floating-point constants are now kept as strings unless they are involved in constant expressions that get simplified. The floating-point constants kept as strings can have arbitrarily many significant figures and a very large exponent field (as large as long int allows on the machine on which f2c runs). Thus, for example, the body of subroutine zot(x) double precision x(6), pi parameter (pi=3.1415926535897932384626433832795028841972) x(1) = pi x(2) = pi+1 x(3) = 9287349823749272.7429874923740978492734D-298374 x(4) = .89 x(5) = 4.0005 x(6) = 10D7 end now gets translated into x[1] = 3.1415926535897932384626433832795028841972; x[2] = 4.1415926535897931; x[3] = 9.2873498237492727429874923740978492734e-298359; x[4] = (float).89; x[5] = (float)4.0005; x[6] = 1e8; rather than the former x[1] = 3.1415926535897931; x[2] = 4.1415926535897931; x[3] = 0.; x[4] = (float)0.89000000000000003; x[5] = (float)4.0004999999999997; x[6] = 100000000.; Recognition of f77 machine-constant intrinsics deleted, i.e., epbase, epprec, epemin, epemax, eptiny, ephuge, epmrsp. 22 Nov. 1989: Workarounds for glitches on some Sun systems... libf77: libF77/makefile modified to point out possible need to compile libF77/main.c with -Donexit=on_exit . libi77: libI77/wref.c (and libI77/README) modified so non-ANSI systems can compile with USE_STRLEN defined, which will cause sprintf(b = buf, "%#.*f", d, x); n = strlen(b) + d1; rather than n = sprintf(b = buf, "%#.*f", d, x) + d1; to be compiled. 26 Nov. 1989: Longer names are now accepted (up to 50 characters); names may contain underscores (in which case they will have two underscores appended, to avoid clashes with library names). 28 Nov. 1989: libi77 updated: 1. Allow 3 (or, on Crays, 4) digit exponents under format Ew.d . 2. Try to get things right on machines where ints have 16 bits. 29 Nov. 1989: Supplied missing semicolon in parameterless subroutines that have multiple entry points (all of them parameterless). 30 Nov. 1989: libf77 and libi77 revised to use types from f2c.h. f2c now types floating-point valued C library routines as "double" rather than "doublereal" (for use with nonstandard C compilers for which "double" is IEEE double extended). 1 Dec. 1989: f2c.h updated to eliminate #defines rendered unnecessary (and, indeed, dangerous) by change of 26 Nov. to long names possibly containing underscores. libi77 further revised: yesterday's change omitted two tweaks to fmt.h (tweaks which only matter if float and real or double and doublereal are different types). 2 Dec. 1989: Better error message (than "bad tag") for NAMELIST, which no longer inhibits C output. 4 Dec. 1989: Allow capital letters in hex constants (f77 extension; e.g., x'a012BCd', X'A012BCD' and x'a012bcd' are all treated as the integer 167848909). libi77 further revised: lio.c lio.h lread.c wref.c wrtfmt.c tweaked again to allow float and real or double and doublereal to be different. 6 Dec. 1989: Revised f2c.h -- required for the following... Simpler looking translations for abs, min, max, using #defines in revised f2c.h . libi77: more corrections to types; additions for NAMELIST. Corrected casts in some I/O calls. Translation of NAMELIST; libi77 must still be revised. Currently libi77 gives you a run-time error message if you attempt NAMELIST I/O. 7 Dec. 1989: Fixed bug that prevented local integer variables that appear in DATA stmts from being ASSIGNed statement labels. Fillers (for DATA statements initializing EQUIVALENCEd variables and variables in COMMON) typed integer rather than doublereal (for slightly more portability, e.g. to Crays). libi77: missing return values supplied in a few places; some tests reordered for better working on the Cray. libf77: better accuracy for complex divide, complex square root, real mod function (casts to double; double temporaries). 9 Dec. 1989: Fixed bug that caused needless (albeit harmless) empty lines to be inserted in the C output when a comment line contained trailing blanks. Further tweak to type of fillers: allow doublereal fillers if the struct has doublereal data. 11 Dec. 1989: Alteration of rule for producing external (C) names from names that contain underscores. Now the external name is always obtained by appending a pair of underscores. 12 Dec. 1989: C production inhibited after most errors. 15 Dec. 1989: Fixed bug in headers for subroutines having two or more character strings arguments: the length arguments were reversed. 19 Dec. 1989: f2c.h libf77 libi77: adjusted so #undefs in f2c.h should not foil compilation of libF77 and libI77. libf77: getenv_ adjusted to work with unsorted environments. libi77: the iostat= specifier should now work right with internal I/O. 20 Dec. 1989: f2c bugs fixed: In the absence of an err= specifier, the iostat= specifier was generally set wrong. Character strings containing explicit nulls (\0) were truncated at the first null. Unlabeled DO loops recognized; must be terminated by ENDDO. (Don't ask for CYCLE, EXIT, named DO loops, or DO WHILE.) 29 Dec. 1989: Nested unlabeled DO loops now handled properly; new warning for extraneous text at end of FORMAT. 30 Dec. 1989: Fixed bug in translating dble(real(...)), dble(sngl(...)), and dble(float(...)), where ... is either of type double complex or is an expression requiring assignment to intermediate variables (e.g., dble(real(foo(x+1))), where foo is a function and x is a variable). Regard nonblank label fields on continuation lines as an error. 3 Jan. 1990: New option -C++ yields output that should be understood by C++ compilers. 6 Jan. 1989: -a now excludes variables that appear in a namelist from those that it makes automatic. (As before, it also excludes variables that appear in a common, data, equivalence, or save statement.) The syntactically correct Fortran read(*,i) x end now yields syntactically correct C (even though both the Fortran and C are buggy -- no FORMAT has not been ASSIGNed to i). 7 Jan. 1990: libi77: routines supporting NAMELIST added. Surrounding quotes made optional when no ambiguity arises in a list or namelist READ of a character-string value. 9 Jan. 1990: f2c.src made available. 16 Jan. 1990: New options -P to produce ANSI C or C++ prototypes for procedures defined. Change to -A and -C++: f2c tries to infer prototypes for invoked procedures unless the new -!P option is given. New warning messages for inconsistent calling sequences among procedures within a single file. Most of f2c/src is affected. f2c.h: typedefs for procedure arguments added; netlib's f2c service will insert appropriate typedefs for use with older versions of f2c.h. 17 Jan. 1990: f2c/src: defs.h exec.c format.c proc.c putpcc.c version.c xsum0.out updated. Castargs and protofile made extern in defs.h; exec.c modified so superfluous else clauses are diagnosed; unused variables omitted from declarations in format.c proc.c putpcc.c . 21 Jan. 1990: No C emitted for procedures declared external but not referenced. f2c.h: more new types added for use with -P. New feature: f2c accepts as arguments files ending in .p or .P; such files are assumed to be prototype files, such as produced by the -P option. All prototype files are read before any Fortran files and apply globally to all Fortran files. Suitable prototypes help f2c warn about calling-sequence errors and can tell f2c how to type procedures declared external but not explicitly typed; the latter is mainly of interest for users of the -A and -C++ options. (Prototype arguments are not available to netlib's "execute f2c" service.) New option -it tells f2c to try to infer types of untyped external arguments from their use as parameters to prototyped or previously defined procedures. f2c/src: many minor cleanups; most modules changed. Individual files in f2c/src are now in "bundle" format. The former f2c.1 is now f2c.1t; "f2c.1t from f2c" and "f2c.1t from f2c/src" are now the same, as are "f2c.1 from f2c" and "f2c.1 from f2c/src". People who do not obtain a new copy of "all from f2c/src" should at least add fclose(sortfp); after the call on do_init_data(outfile, sortfp) in format_data.c . 22 Jan. 1990: Cleaner man page wording (thanks to Doug McIlroy). -it now also applies to all untyped EXTERNAL procedures, not just arguments. 23 Jan. 01:34:00 EST 1990: Bug fixes: under -A and -C++, incorrect C was generated for subroutines having multiple entries but no arguments. Under -A -P, subroutines of no arguments were given prototype calling sequence () rather than (void). Character-valued functions elicited erroneous warning messages about inconsistent calling sequences when referenced by another procedure in the same file. f2c.1t: omit first appearance of libF77.a in FILES section; load order of libraries is -lF77 -lI77, not vice versa (bug introduced in yesterday's edits); define .F macro for those whose -man lacks it. (For a while after yesterday's fixes were posted, f2c.1t was out of date. Sorry!) 23 Jan. 9:53:24 EST 1990: Character substring expressions involving function calls having character arguments (including the intrinsic len function) yielded incorrect C. Procedures defined after invocation (in the same file) with conflicting argument types also got an erroneous message about the wrong number of arguments. 24 Jan. 11:44:00 EST 1990: Bug fixes: -p omitted #undefs; COMMON block names containing underscores had their C names incorrectly computed; a COMMON block having the name of a previously defined procedure wreaked havoc; if all arguments were .P files, f2c tried reading the second as a Fortran file. New feature: -P emits comments showing COMMON block lengths, so one can get warnings of incompatible COMMON block lengths by having f2c read .P (or .p) files. Now by running f2c twice, first with -P -!c (or -P!c), then with *.P among the arguments, you can be warned of inconsistent COMMON usage, and COMMON blocks having inconsistent lengths will be given the maximum length. (The latter always did happen within each input file; now -P lets you extend this behavior across files.) 26 Jan. 16:44:00 EST 1990: Option -it made less aggressive: untyped external procedures that are invoked are now typed by the rules of Fortran, rather than by previous use of procedures to which they are passed as arguments before being invoked. Option -P now includes information about references, i.e., called procedures, in the prototype files (in the form of special comments). This allows iterative invocations of f2c to infer more about untyped external names, particularly when multiple Fortran files are involved. As usual, there are some obscure bug fixes: 1. Repair of erroneous warning messages about inconsistent number of arguments that arose when a character dummy parameter was discovered to be a function or when multiple entry points involved character variables appearing in a previous entry point. 2. Repair of memory fault after error msg about "adjustable character function". 3. Under -U, allow MAIN_ as a subroutine name (in the same file as a main program). 4. Change for consistency: a known function invoked as a subroutine, then as a function elicits a warning rather than an error. 26 Jan. 22:32:00 EST 1990: Fixed two bugs that resulted in incorrect C for substrings, within the body of a character-valued function, of the function's name, when those substrings were arguments to another function (even implicitly, as in character-string assignment). 28 Jan. 18:32:00 EST 1990: libf77, libi77: checksum files added; "make check" looks for transmission errors. NAMELIST read modified to allow $ rather than & to precede a namelist name, to allow $ rather than / to terminate input where the name of another variable would otherwise be expected, and to regard all nonprinting ASCII characters <= ' ' as spaces. 29 Jan. 02:11:00 EST 1990: "fc from f2c" added. -it option made the default; -!it turns it off. Type information is now updated in a previously missed case. -P option tweaked again; message about when rerunning f2c may change prototypes or declarations made more accurate. New option -Ps implies -P and returns exit status 4 if rerunning f2c -P with prototype inputs might change prototypes or declarations. Now you can execute a crude script like cat *.f >zap.F rm -f zap.P while :; do f2c -Ps -!c zap.[FP] case $? in 4) ;; *) break;; esac done to get a file zap.P of the best prototypes f2c can determine for *.f . Jan. 29 07:30:21 EST 1990: Forgot to check for error status when setting return code 4 under -Ps; error status (1, 2, 3, or, for caught signal, 126) now takes precedence. Jan 29 14:17:00 EST 1990: Incorrect handling of open(n,'filename') repaired -- now treated as open(n,file='filename') (and, under -ext, given an error message). New optional source file memset.c for people whose systems don't provide memset, memcmp, and memcpy; #include in mem.c changed to #include "string.h" so BSD people can create a local string.h that simply says #include . Jan 30 10:34:00 EST 1990: Fix erroneous warning at end of definition of a procedure with character arguments when the procedure had previously been called with a numeric argument instead of a character argument. (There were two warnings, the second one incorrectly complaining of a wrong number of arguments.) Jan 30 16:29:41 EST 1990: Fix case where -P and -Ps erroneously reported another iteration necessary. (Only harm is the extra iteration.) Feb 3 01:40:00 EST 1990: Supply semicolon occasionally omitted under -c . Try to force correct alignment when numeric variables are initialized with character data (a non-standard and non-portable practice). You must use the -W option if your code has such data statements and is meant to run on a machine with other than 4 characters/word; e.g., for code meant to run on a Cray, you would specify -W8 . Allow parentheses around expressions in output lists (in write and print statements). Rename source files so their names are <= 12 characters long (so there's room to append .Z and still have <= 14 characters); renamed files: formatdata.c niceprintf.c niceprintf.h safstrncpy.c . f2c material made available by anonymous ftp from research.att.com (look in dist/f2c ). Feb 3 03:49:00 EST 1990: Repair memory fault that arose from use (in an assignment or call) of a non-argument variable declared CHARACTER*(*). Feb 9 01:35:43 EST 1990: Fix erroneous error msg about bad types in subroutine foo(a,adim) dimension a(adim) integer adim Fix improper passing of character args (and possible memory fault) in the expression part of a computed goto. Fix botched calling sequences in array references involving functions having character args. Fix memory fault caused by invocation of character-valued functions of no arguments. Fix botched calling sequence of a character*1-valued function assigned to a character*1 variable. Fix bug in error msg for inconsistent number of args in prototypes. Allow generation of C output despite inconsistencies in prototypes, but give exit code 8. Simplify include logic (by removing some bogus logic); never prepend "/usr/include/" to file names. Minor cleanups (that should produce no visible change in f2c's behavior) in intr.c parse.h main.c defs.h formatdata.c p1output.c . Feb 10 00:19:38 EST 1990: Insert (integer) casts when floating-point expressions are used as subscripts. Make SAVE stmt (with no variable list) override -a . Minor cleanups: change field to Field in struct Addrblock (for the benefit of buggy C compilers); omit system("/bin/cp ...") in misc.c . Feb 13 00:39:00 EST 1990: Error msg fix in gram.dcl: change "cannot make %s parameter" to "cannot make into parameter". Feb 14 14:02:00 EST 1990: Various cleanups (invisible on systems with 4-byte ints), thanks to Dave Regan: vaxx.c eliminated; %d changed to %ld various places; external names adjusted for the benefit of stupid systems (that ignore case and recognize only 6 significant characters in external names); buffer shortened in xsum.c (e.g. for MS-DOS); fopen modes distinguish text and binary files; several unused functions eliminated; missing arg supplied to an unlikely fatalstr invocation. Thu Feb 15 19:15:53 EST 1990: More cleanups (invisible on systems with 4 byte ints); casts inserted so most complaints from cyntax(1) and lint(1) go away; a few (int) versus (long) casts corrected. Fri Feb 16 19:55:00 EST 1990: Recognize and translate unnamed Fortran 8x do while statements. Fix bug that occasionally caused improper breaking of character strings. New error message for attempts to provide DATA in a type-declaration statement. Sat Feb 17 11:43:00 EST 1990: Fix infinite loop clf -> Fatal -> done -> clf after I/O error. Change "if (addrp->vclass = CLPROC)" to "if (addrp->vclass == CLPROC)" in p1_addr (in p1output.c); this was probably harmless. Move a misplaced } in lex.c (which slowed initkey()). Thanks to Gary Word for pointing these things out. Sun Feb 18 18:07:00 EST 1990: Detect overlapping initializations of arrays and scalar variables in previously missed cases. Treat logical*2 as logical (after issuing a warning). Don't pass string literals to p1_comment(). Correct a cast (introduced 16 Feb.) in gram.expr; this matters e.g. on a Cray. Attempt to isolate UNIX-specific things in sysdep.c (a new source file). Unless sysdep.c is compiled with SYSTEM_SORT defined, the intermediate files created for DATA statements are now sorted in-core without invoking system(). Tue Feb 20 16:10:35 EST 1990: Move definition of binread and binwrite from init.c to sysdep.c . Recognize Fortran 8x tokens < <= == >= > <> as synonyms for .LT. .LE. .EQ. .GE. .GT. .NE. Minor cleanup in putpcc.c: fully remove simoffset(). More discussion of system dependencies added to libI77/README. Tue Feb 20 21:44:07 EST 1990: Minor cleanups for the benefit of EBCDIC machines -- try to remove the assumption that 'a' through 'z' are contiguous. (Thanks again to Gary Word.) Also, change log2 to log_2 (shouldn't be necessary). Wed Feb 21 06:24:56 EST 1990: Fix botch in init.c introduced in previous change; only matters to non-ASCII machines. Thu Feb 22 17:29:12 EST 1990: Allow several entry points to mention the same array. Protect parameter adjustments with if's (for the case that an array is not an argument to all entrypoints). Under -u, allow subroutine foo(x,n) real x(n) integer n Compute intermediate variables used to evaluate dimension expressions at the right time. Example previously mistranslated: subroutine foo(x,k,m,n) real x(min(k,m,n)) ... write(*,*) x Detect duplicate arguments. (The error msg points to the first executable stmt -- not wonderful, but not worth fixing.) Minor cleanup of min/max computation (sometimes slightly simpler). Sun Feb 25 09:39:01 EST 1990: Minor tweak to multiple entry points: protect parameter adjustments with if's only for (array) args that do not appear in all entry points. Minor tweaks to format.c and io.c (invisible unless your compiler complained at the duplicate #defines of IOSUNIT and IOSFMT or at comparisons of p1gets(...) with NULL). Sun Feb 25 18:40:10 EST 1990: Fix bug introduced Feb. 22: if a subprogram contained DATA and the first executable statement was labeled, then the label got lost. (Just change INEXEC to INDATA in p1output.c; it occurs just once.) Mon Feb 26 17:45:10 EST 1990: Fix bug in handling of " and ' in comments. Wed Mar 28 01:43:06 EST 1990: libI77: 1. Repair nasty I/O bug: opening two files and closing the first (after possibly reading or writing it), then writing the second caused the last buffer of the second to be lost. 2. Formatted reads of logical values treated all letters other than t or T as f (false). libI77 files changed: err.c rdfmt.c Version.c (Request "libi77 from f2c" -- you can't get these files individually.) f2c itself: Repair nasty bug in translation of ELSE IF (condition involving complicated abs, min, or max) -- auxiliary statements were emitted at the wrong place. Supply semicolon previously omitted from the translation of a label (of a CONTINUE) immediately preceding an ELSE IF or an ELSE. This bug made f2c produce invalid C. Correct a memory fault that occurred (on some machines) when the error message "adjustable dimension on non-argument" should be given. Minor tweaks to remove some harmless warnings by overly chatty C compilers. Argument arays having constant dimensions but a variable lower bound (e.g., x(n+1:n+3)) had a * omitted from scalar arguments involved in the array offset computation. Wed Mar 28 18:47:59 EST 1990: libf77: add exit(0) to end of main [return(0) encounters a Cray bug] Sun Apr 1 16:20:58 EDT 1990: Avoid dereferencing null when processing equivalences after an error. Fri Apr 6 08:29:49 EDT 1990: Calls involving alternate return specifiers omitted processing needed for things like min, max, abs, and // (concatenation). INTEGER*2 PARAMETERs were treated as INTEGER*4. Convert some O(n^2) parsing to O(n). Tue Apr 10 20:07:02 EDT 1990: When inconsistent calling sequences involve differing numbers of arguments, report the first differing argument rather than the numbers of arguments. Fix bug under -a: formatted I/O in which either the unit or the format was a local character variable sometimes resulted in invalid C (a static struct initialized with an automatic component). Improve error message for invalid flag after elided -. Complain when literal table overflows, rather than infinitely looping. (The complaint mentions the new and otherwise undocumented -NL option for specifying a larger literal table.) New option -h for forcing strings to word (or, with -hd, double-word) boundaries where possible. Repair a bug that could cause improper splitting of strings. Fix bug (cast of c to doublereal) in subroutine foo(c,r) double complex c double precision r c = cmplx(r,real(c)) end New include file "sysdep.h" has some things from defs.h (and elsewhere) that one may need to modify on some systems. Some large arrays that were previously statically allocated are now dynamically allocated when f2c starts running. f2c/src files changed: README cds.c defs.h f2c.1 f2c.1t format.c formatdata.c init.c io.c lex.c main.c makefile mem.c misc.c names.c niceprintf.c output.c parse_args.c pread.c put.c putpcc.c sysdep.h version.c xsum0.out Wed Apr 11 18:27:12 EDT 1990: Fix bug in argument consistency checking of character, complex, and double complex valued functions. If the same source file contained a definition of such a function with arguments not explicitly typed, then subsequent references to the function might get erroneous warnings of inconsistent calling sequences. Tweaks to sysdep.h for partially ANSI systems. New options -kr and -krd cause f2c to use temporary variables to enforce Fortran evaluation-order rules with pernicious, old-style C compilers that apply the associative law to floating-point operations. Sat Apr 14 15:50:15 EDT 1990: libi77: libI77 adjusted to allow list-directed and namelist I/O of internal files; bug in namelist I/O of logical and character arrays fixed; list input of complex numbers adjusted to permit d or D to denote the start of the exponent field of a component. f2c itself: fix bug in handling complicated lower-bound expressions for character substrings; e.g., min and max did not work right, nor did function invocations involving character arguments. Switch to octal notation, rather than hexadecimal, for nonprinting characters in character and string constants. Fix bug (when neither -A nor -C++ was specified) in typing of external arguments of type complex, double complex, or character: subroutine foo(c) external c complex c now results in /* Complex */ int (*c) (); (as, indeed, it once did) rather than complex (*c) (); Sat Apr 14 22:50:39 EDT 1990: libI77/makefile: updated "make check" to omit lio.c lib[FI]77/makefile: trivial change: define CC = cc, reference $(CC). (Request, e.g., "libi77 from f2c" -- you can't ask for individual files from lib[FI]77.) Wed Apr 18 00:56:37 EDT 1990: Move declaration of atof() from defs.h to sysdep.h, where it is now not declared if stdlib.h is included. (NeXT's stdlib.h has a #define atof that otherwise wreaks havoc.) Under -u, provide a more intelligible error message (than "bad tag") for an attempt to define a function without specifying its type. Wed Apr 18 17:26:27 EDT 1990: Recognize \v (vertical tab) in Hollerith as well as quoted strings; add recognition of \r (carriage return). New option -!bs turns off recognition of escapes in character strings (\0, \\, \b, \f, \n, \r, \t, \v). Move to sysdep.c initialization of some arrays whose initialization assumed ASCII; #define Table_size in sysdep.h rather than using hard-coded 256 in allocating arrays of size 1 << (bits/byte). Thu Apr 19 08:13:21 EDT 1990: Warn when escapes would make Hollerith extend beyond statement end. Omit max() definition from misc.c (should be invisible except on systems that erroneously #define max in stdlib.h). Mon Apr 23 22:24:51 EDT 1990: When producing default-style C (no -A or -C++), cast switch expressions to (int). Move "-lF77 -lI77 -lm -lc" to link_msg, defined in sysdep.c . Add #define scrub(x) to sysdep.h, with invocations in format.c and formatdata.c, so that people who have systems like VMS that would otherwise create multiple versions of intermediate files can #define scrub(x) unlink(x) Tue Apr 24 18:28:36 EDT 1990: Pass string lengths once rather than twice to a function of character arguments involved in comparison of character strings of length 1. Fri Apr 27 13:11:52 EDT 1990: Fix bug that made f2c gag on concatenations involving char(...) on some systems. Sat Apr 28 23:20:16 EDT 1990: Fix control-stack bug in if(...) then else if (complicated condition) else endif (where the complicated condition causes assignment to an auxiliary variable, e.g., max(a*b,c)). Mon Apr 30 13:30:10 EDT 1990: Change fillers for DATA with holes from substructures to arrays (in an attempt to make things work right with C compilers that have funny padding rules for substructures, e.g., Sun C compilers). Minor cleanup of exec.c (should not affect generated C). Mon Apr 30 23:13:51 EDT 1990: Fix bug in handling return values of functions having multiple entry points of differing return types. Sat May 5 01:45:18 EDT 1990: Fix type inference bug in subroutine foo(x) call goo(x) end subroutine goo(i) i = 3 end Instead of warning of inconsistent calling sequences for goo, f2c was simply making i a real variable; now i is correctly typed as an integer variable, and f2c issues an error message. Adjust error messages issued at end of declarations so they don't blame the first executable statement. Sun May 6 01:29:07 EDT 1990: Fix bug in -P and -Ps: warn when the definition of a subprogram adds information that would change prototypes or previous declarations. Thu May 10 18:09:15 EDT 1990: Fix further obscure bug with (default) -it: inconsistent calling sequences and I/O statements could interact to cause a memory fault. Example: SUBROUTINE FOO CALL GOO(' Something') ! Forgot integer first arg END SUBROUTINE GOO(IUNIT,MSG) CHARACTER*(*)MSG WRITE(IUNIT,'(1X,A)') MSG END Fri May 11 16:49:11 EDT 1990: Under -!c, do not delete any .c files (when there are errors). Avoid dereferencing 0 when a fatal error occurs while reading Fortran on stdin. Wed May 16 18:24:42 EDT 1990: f2c.ps made available. Mon Jun 4 12:53:08 EDT 1990: Diagnose I/O units of invalid type. Add specific error msg about dummy arguments in common. Wed Jun 13 12:43:17 EDT 1990: Under -A, supply a missing "[1]" for CHARACTER*1 variables that appear both in a DATA statement and in either COMMON or EQUIVALENCE. Mon Jun 18 16:58:31 EDT 1990: Trivial updates to f2c.ps . ("Fortran 8x" --> "Fortran 90"; omit "(draft)" from "(draft) ANSI C".) Tue Jun 19 07:36:32 EDT 1990: Fix incorrect code generated for ELSE IF(expression involving function call passing non-constant substring). Under -h, preserve the property that strings are null-terminated where possible. Remove spaces between # and define in lex.c output.c parse.h . Mon Jun 25 07:22:59 EDT 1990: Minor tweak to makefile to reduce unnecessary recompilations. Tue Jun 26 11:49:53 EDT 1990: Fix unintended truncation of some integer constants on machines where casting a long to (int) may change the value. E.g., when f2c ran on machines with 16-bit ints, "i = 99999" was being translated to "i = -31073;". Wed Jun 27 11:05:32 EDT 1990: Arrange for CHARACTER-valued PARAMETERs to honor their length specifications. Allow CHAR(nn) in expressions defining such PARAMETERs. Fri Jul 20 09:17:30 EDT 1990: Avoid dereferencing 0 when a FORMAT statement has no label. Thu Jul 26 11:09:39 EDT 1990: Remarks about VOID and binread,binwrite added to README. Tweaks to parse_args: should be invisible unless your compiler complained at (short)*store. Thu Aug 2 02:07:58 EDT 1990: f2c.ps: change the first line of page 5 from include stuff to include 'stuff' Tue Aug 14 13:21:24 EDT 1990: libi77: libI77 adjusted to treat tabs as spaces in list input. Fri Aug 17 07:24:53 EDT 1990: libi77: libI77 adjusted so a blank='ZERO' clause (upper case Z) in an open of a currently open file works right. Tue Aug 28 01:56:44 EDT 1990: Fix bug in warnings of inconsistent calling sequences: if an argument to a subprogram was never referenced, then a previous invocation of the subprogram (in the same source file) that passed something of the wrong type for that argument did not elicit a warning message. Thu Aug 30 09:46:12 EDT 1990: libi77: prevent embedded blanks in list output of complex values; omit exponent field in list output of values of magnitude between 10 and 1e8; prevent writing stdin and reading stdout or stderr; don't close stdin, stdout, or stderr when reopening units 5, 6, 0. Tue Sep 4 12:30:57 EDT 1990: Fix bug in C emitted under -I2 or -i2 for INTEGER*4 FUNCTION. Warn of missing final END even if there are previous errors. Fri Sep 7 13:55:34 EDT 1990: Remark about "make xsum.out" and "make f2c" added to README. Tue Sep 18 23:50:01 EDT 1990: Fix null dereference (and, on some systems, writing of bogus *_com.c files) under -ec or -e1c when a prototype file (*.p or *.P) describes COMMON blocks that do not appear in the Fortran source. libi77: Add some #ifdef lines (#ifdef MSDOS, #ifndef MSDOS) to avoid references to stat and fstat on non-UNIX systems. On UNIX systems, add component udev to unit; decide that old and new files are the same iff both the uinode and udev components of unit agree. When an open stmt specifies STATUS='OLD', use stat rather than access (on UNIX systems) to check the existence of the file (in case directories leading to the file have funny permissions and this is a setuid or setgid program). Thu Sep 27 16:04:09 EDT 1990: Supply missing entry for Impldoblock in blksize array of cpexpr (in expr.c). No examples are known where this omission caused trouble. Tue Oct 2 22:58:09 EDT 1990: libf77: test signal(...) == SIG_IGN rather than & 01 in main(). libi77: adjust rewind.c so two successive rewinds after a write don't clobber the file. Thu Oct 11 18:00:14 EDT 1990: libi77: minor cleanups: add #include "fcntl.h" to endfile.c, err.c, open.c; adjust g_char in util.c for segmented memories; in f_inqu (inquire.c), define x appropriately when MSDOS is defined. Mon Oct 15 20:02:11 EDT 1990: Add #ifdef MSDOS pointer adjustments to mem.c; treat NAME= as a synonym for FILE= in OPEN statements. Wed Oct 17 16:40:37 EDT 1990: libf77, libi77: minor cleanups: _cleanup() and abort() invocations replaced by invocations of sig_die in main.c; some error messages previously lost in buffers will now appear. Mon Oct 22 16:11:27 EDT 1990: libf77: separate sig_die from main (for folks who don't want to use the main in libF77). libi77: minor tweak to comments in README. Fri Nov 2 13:49:35 EST 1990: Use two underscores rather than one in generated temporary variable names to avoid conflict with COMMON names. f2c.ps updated to reflect this change and the NAME= extension introduced 15 Oct. Repair a rare memory fault in io.c . Mon Nov 5 16:43:55 EST 1990: libi77: changes to open.c (and err.c): complain if an open stmt specifies new= and the file already exists (as specified by Fortrans 77 and 90); allow file= to be omitted in open stmts and allow status='replace' (Fortran 90 extensions). Fri Nov 30 10:10:14 EST 1990: Adjust malloc.c for unusual systems whose sbrk() can return values not properly aligned for doubles. Arrange for slightly more helpful and less repetitive warnings for non-character variables initialized with character data; these warnings are (still) suppressed by -w66. Fri Nov 30 15:57:59 EST 1990: Minor tweak to README (about changing VOID in f2c.h). Mon Dec 3 07:36:20 EST 1990: Fix spelling of "character" in f2c.1t. Tue Dec 4 09:48:56 EST 1990: Remark about link_msg and libf2c added to f2c/README. Thu Dec 6 08:33:24 EST 1990: Under -U, render label nnn as L_nnn rather than Lnnn. Fri Dec 7 18:05:00 EST 1990: Add more names from f2c.h (e.g. integer, real) to the c_keywords list of names to which an underscore is appended to avoid confusion. Mon Dec 10 19:11:15 EST 1990: Minor tweaks to makefile (./xsum) and README (binread/binwrite). libi77: a few modifications for POSIX systems; meant to be invisible elsewhere. Sun Dec 16 23:03:16 EST 1990: Fix null dereference caused by unusual erroneous input, e.g. call foo('abc') end subroutine foo(msg) data n/3/ character*(*) msg end (Subroutine foo is illegal because the character statement comes after a data statement.) Use decimal rather than hex constants in xsum.c (to prevent erroneous warning messages about constant overflow). Mon Dec 17 12:26:40 EST 1990: Fix rare extra underscore in character length parameters passed for multiple entry points. Wed Dec 19 17:19:26 EST 1990: Allow generation of C despite error messages about bad alignment forced by equivalence. Allow variable-length concatenations in I/O statements, such as open(3, file=bletch(1:n) // '.xyz') Fri Dec 28 17:08:30 EST 1990: Fix bug under -p with formats and internal I/O "units" in COMMON, as in COMMON /FIGLEA/F CHARACTER*20 F F = '(A)' WRITE (*,FMT=F) 'Hello, world!' END Tue Jan 15 12:00:24 EST 1991: Fix bug when two equivalence groups are merged, the second with nonzero offset, and the result is then merged into a common block. Example: INTEGER W(3), X(3), Y(3), Z(3) COMMON /ZOT/ Z EQUIVALENCE (W(1),X(1)), (X(2),Y(1)), (Z(3),X(1)) ***** W WAS GIVEN THE WRONG OFFSET Recognize Fortran 90's optional NML= in NAMELIST READs and WRITEs. (Currently NML= and FMT= are treated as synonyms -- there's no error message if, e.g., NML= specifies a format.) libi77: minor adjustment to allow internal READs from character string constants in read-only memory. Fri Jan 18 22:56:15 EST 1991: Add comment to README about needing to comment out the typedef of size_t in sysdep.h on some systems, e.g. Sun 4.1. Fix misspelling of "statement" in an error message in lex.c Wed Jan 23 00:38:48 EST 1991: Allow hex, octal, and binary constants to have the qualifying letter (z, x, o, or b) either before or after the quoted string containing the digits. For now this change will not be reflected in f2c.ps . Tue Jan 29 16:23:45 EST 1991: Arrange for character-valued statement functions to give results of the right length (that of the statement function's name). Wed Jan 30 07:05:32 EST 1991: More tweaks for character-valued statement functions: an error check and an adjustment so a right-hand side of nonconstant length (e.g., a substring) is handled right. Wed Jan 30 09:49:36 EST 1991: Fix p1_head to avoid printing (char *)0 with %s. Thu Jan 31 13:53:44 EST 1991: Add a test after the cleanup call generated for I/O statements with ERR= or END= clauses to catch the unlikely event that the cleanup routine encounters an error. Mon Feb 4 08:00:58 EST 1991: Minor cleanup: omit unneeded jumps and labels from code generated for some NAMELIST READs and WRITEs with IOSTAT=, ERR=, and/or END=. Tue Feb 5 01:39:36 EST 1991: Change Mktemp to mktmp (for the benefit of systems so brain-damaged that they do not distinguish case in external names -- and that for some reason want to load mktemp). Try to get xsum0.out right this time (it somehow didn't get updated on 4 Feb. 1991). Add note to libi77/README about adjusting the interpretation of RECL= specifiers in OPENs for direct unformatted I/O. Thu Feb 7 17:24:42 EST 1991: New option -r casts values of REAL functions, including intrinsics, to REAL. This only matters for unportable code like real r r = asin(1.) if (r .eq. asin(1.)) ... [The behavior of such code varies with the Fortran compiler used -- and sometimes is affected by compiler options.] For now, the man page at the end of f2c.ps is the only part of f2c.ps that reflects this new option. Fri Feb 8 18:12:51 EST 1991: Cast pointer differences passed as arguments to the appropriate type. This matters, e.g., with MSDOS compilers that yield a long pointer difference but have int == short. Disallow nonpositive dimensions. Fri Feb 15 12:24:15 EST 1991: Change %d to %ld in sprintf call in putpower in putpcc.c. Free more memory (e.g. allowing translation of larger Fortran files under MS-DOS). Recognize READ (character expression) and WRITE (character expression) as formatted I/O with the format given by the character expression. Update year in Notice. Sat Feb 16 00:42:32 EST 1991: Recant recognizing WRITE(character expression) as formatted output -- Fortran 77 is not symmetric in its syntax for READ and WRITE. Mon Mar 4 15:19:42 EST 1991: Fix bug in passing the real part of a complex argument to an intrinsic function. Omit unneeded parentheses in nested calls to intrinsics. Example: subroutine foo(x, y) complex y x = exp(sin(real(y))) + exp(imag(y)) end Fri Mar 8 15:05:42 EST 1991: Fix a comment in expr.c; omit safstrncpy.c (which had bugs in cases not used by f2c). Wed Mar 13 02:27:23 EST 1991: Initialize firstmemblock->next in mem_init in mem.c . [On most systems it was fortuituously 0, but with System V, -lmalloc could trip on this missed initialization.] Wed Mar 13 11:47:42 EST 1991: Fix a reference to freed memory. Wed Mar 27 00:42:19 EST 1991: Fix a memory fault caused by such illegal Fortran as function foo x = 3 logical foo ! declaration among executables foo=.false. ! used to suffer memory fault end Fri Apr 5 08:30:31 EST 1991: Fix loss of % in some format expressions, e.g. write(*,'(1h%)') Fix botch introduced 27 March 1991 that caused subroutines with multiple entry points to have extraneous declarations of ret_val. Fri Apr 5 12:44:02 EST 1991 Try again to omit extraneous ret_val declarations -- this morning's fix was sometimes wrong. Mon Apr 8 13:47:06 EDT 1991: Arrange for s_rnge to have the right prototype under -A -C . Wed Apr 17 13:36:03 EDT 1991: New fatal error message for apparent invocation of a recursive statement function. Thu Apr 25 15:13:37 EDT 1991: F2c and libi77 adjusted so NAMELIST works with -i2. (I forgot about -i2 when adding NAMELIST.) This required a change to f2c.h (that only affects NAMELIST I/O under -i2.) Man-page description of -i2 adjusted to reflect that -i2 stores array lengths in short ints. Fri Apr 26 02:54:41 EDT 1991: Libi77: fix some bugs in NAMELIST reading of multi-dimensional arrays (file rsne.c). Thu May 9 02:13:51 EDT 1991: Omit a trailing space in expr.c (could cause a false xsum value if a mailer drops the trailing blank). Thu May 16 13:14:59 EDT 1991: Libi77: increase LEFBL in lio.h to overcome a NeXT bug. Tweak for compilers that recognize "nested" comments: inside comments, turn /* into /+ (as well as */ into +/). Sat May 25 11:44:25 EDT 1991: libf77: s_rnge: declare line long int rather than int. Fri May 31 07:51:50 EDT 1991: libf77: system_: officially return status. Mon Jun 17 16:52:53 EDT 1991: Minor tweaks: omit unnecessary declaration of strcmp (that caused trouble on a system where strcmp was a macro) from misc.c; add SHELL = /bin/sh to makefiles. Fix a dereference of null when a CHARACTER*(*) declaration appears (illegally) after DATA. Complain only once per subroutine about declarations appearing after DATA. Mon Jul 1 00:28:13 EDT 1991: Add test and error message for illegal use of subroutine names, e.g. SUBROUTINE ZAP(A) ZAP = A END Mon Jul 8 21:49:20 EDT 1991: Issue a warning about things like integer i i = 'abc' (which is treated as i = ichar('a')). [It might be nice to treat 'abc' as an integer initialized (in a DATA statement) with 'abc', but other matters have higher priority.] Render i = ichar('A') as i = 'A'; rather than i = 65; (which assumes ASCII). Fri Jul 12 07:41:30 EDT 1991: Note added to README about erroneous definitions of __STDC__ . Sat Jul 13 13:38:54 EDT 1991: Fix bugs in double type convesions of complex values, e.g. sngl(real(...)) or dble(real(...)) (where ... is complex). Mon Jul 15 13:21:42 EDT 1991: Fix bug introduced 8 July 1991 that caused erroneous warnings "ichar([first char. of] char. string) assumed for conversion to numeric" when a subroutine had an array of character strings as an argument. Wed Aug 28 01:12:17 EDT 1991: Omit an unused function in format.c, an unused variable in proc.c . Under -r8, promote complex to double complex (as the man page claims). Fri Aug 30 17:19:17 EDT 1991: f2c.ps updated: slightly expand description of intrinsics and,or,xor, not; add mention of intrinsics lshift, rshift; add note about f2c accepting Fortran 90 inline comments (starting with !); update Cobalt Blue address. Tue Sep 17 07:17:33 EDT 1991: libI77: err.c and open.c modified to use modes "rb" and "wb" when (f)opening unformatted files; README updated to point out that it may be necessary to change these modes to "r" and "w" on some non-ANSI systems. Tue Oct 15 10:25:49 EDT 1991: Minor tweaks that make some PC compilers happier: insert some casts, add args to signal functions. Change -g to emit uncommented #line lines -- and to emit more of them; update fc, f2c.1, f2c.1t, f2c.ps to reflect this. Change uchar to Uchar in xsum.c . Bring gram.c up to date. Thu Oct 17 09:22:05 EDT 1991: libi77: README, fio.h, sue.c, uio.c changed so the length field in unformatted sequential records has type long rather than int (unless UIOLEN_int is #defined). This is for systems where sizeof(int) can vary, depending on the compiler or compiler options. Thu Oct 17 13:42:59 EDT 1991: libi77: inquire.c: when MSDOS is defined, don't strcmp units[i].ufnm when it is NULL. Fri Oct 18 15:16:00 EDT 1991: Correct xsum0.out in "all from f2c/src" (somehow botched on 15 Oct.). Tue Oct 22 18:12:56 EDT 1991: Fix memory fault when a character*(*) argument is used (illegally) as a dummy variable in the definition of a statement function. (The memory fault occurred when the statement function was invoked.) Complain about implicit character*(*). Thu Nov 14 08:50:42 EST 1991: libi77: change uint to Uint in fmt.h, rdfmt.c, wrtfmt.c; this change should be invisible unless you're running a brain-damaged system. Mon Nov 25 19:04:40 EST 1991: libi77: correct botches introduced 17 Oct. 1991 and 14 Nov. 1991 (change uint to Uint in lwrite.c; other changes that only matter if sizeof(int) != sizeof(long)). Add a more meaningful error message when bailing out due to an attempt to invoke a COMMON variable as a function. Sun Dec 1 19:29:24 EST 1991: libi77: uio.c: add test for read failure (seq. unformatted reads); adjust an error return from EOF to off end of record. Tue Dec 10 17:42:28 EST 1991: Add tests to prevent memory faults with bad uses of character*(*). Thu Dec 12 11:24:41 EST 1991: libi77: fix bug with internal list input that caused the last character of each record to be ignored; adjust error message in internal formatted input from "end-of-file" to "off end of record" if the format specifies more characters than the record contains. Wed Dec 18 17:48:11 EST 1991: Fix bug in translating nonsensical ichar invocations involving concatenations. Fix bug in passing intrinsics lle, llt, lge, lgt as arguments; hl_le was being passed rather than l_le, etc. libf77: adjust length parameters from long to ftnlen, for compiling with f2c_i2 defined. Sat Dec 21 15:30:57 EST 1991: Allow DO nnn ... to end with an END DO statement labelled nnn. Tue Dec 31 13:53:47 EST 1991: Fix bug in handling dimension a(n**3,2) -- pow_ii was called incorrectly. Fix bug in translating subroutine x(abc,n) character abc(n) write(abc,'(i10)') 123 end (omitted declaration and initialiation of abc_dim1). Complain about dimension expressions of such invalid types as complex and logical. Fri Jan 17 11:54:20 EST 1992: Diagnose some illegal uses of main program name (rather than memory faulting). libi77: (1) In list and namelist input, treat "r* ," and "r*," alike (where r is a positive integer constant), and fix a bug in handling null values following items with repeat counts (e.g., 2*1,,3). (2) For namelist reading of a numeric array, allow a new name-value subsequence to terminate the current one (as though the current one ended with the right number of null values). (3) [lio.h, lwrite.c]: omit insignificant zeros in list and namelist output. (Compile with -DOld_list_output to get the old behavior.) Sat Jan 18 15:58:01 EST 1992: libi77: make list output consistent with F format by printing .1 rather than 0.1 (introduced yesterday). Wed Jan 22 08:32:43 EST 1992: libi77: add comment to README pointing out preconnection of Fortran units 5, 6, 0 to stdin, stdout, stderr (respectively). Mon Feb 3 11:57:53 EST 1992: libi77: fix namelist read bug that caused the character following a comma to be ignored. Fri Feb 28 01:04:26 EST 1992: libf77: fix buggy z_sqrt.c (double precision square root), which misbehaved for arguments in the southwest quadrant. Thu Mar 19 15:05:18 EST 1992: Fix bug (introduced 17 Jan 1992) in handling multiple entry points of differing types (with implicitly typed entries appearing after the first executable statement). Fix memory fault in the following illegal Fortran: double precision foo(i) * illegal: above should be "double precision function foo(i)" foo = i * 3.2 entry moo(i) end Note about ANSI_Libraries (relevant, e.g., to IRIX 4.0.1 and AIX) added to README. Abort zero divides during constant simplification. Sat Mar 21 01:27:09 EST 1992: Tweak ckalloc (misc.c) for systems where malloc(0) = 0; this matters for subroutines with multiple entry points but no arguments. Add "struct memblock;" to init.c (irrelevant to most compilers). Wed Mar 25 13:31:05 EST 1992: Fix bug with IMPLICIT INTEGER*4(...): under -i2 or -I2, the *4 was ignored. Tue May 5 09:53:55 EDT 1992: Tweaks to README; e.g., ANSI_LIbraries changed to ANSI_Libraries . Wed May 6 23:49:07 EDT 1992 Under -A and -C++, have subroutines return 0 (even if they have no * arguments). Adjust libi77 (rsne.c and lread.c) for systems where ungetc is a macro. Tweak lib[FI]77/makefile to use unique intermediate file names (for parallel makes). Tue May 19 09:03:05 EDT 1992: Adjust libI77 to make err= work with internal list and formatted I/O. Sat May 23 18:17:42 EDT 1992: Under -A and -C++, supply "return 0;" after the code generated for a STOP statement -- the C compiler doesn't know that s_stop won't return. New (mutually exclusive) options: -f treats all input lines as free-format lines, honoring text that appears after column 72 and not padding lines shorter than 72 characters with blanks (which matters if a character string is continued across 2 or more lines). -72 treats text appearing after column 72 as an error. Sun May 24 09:45:37 EDT 1992: Tweak description of -f in f2c.1 and f2c.1t; update f2c.ps . Fri May 29 01:17:15 EDT 1992: Complain about externals used as variables. Example subroutine foo(a,b) external b a = a*b ! illegal use of b; perhaps should be b() end Mon Jun 15 11:15:27 EDT 1992: Fix bug in handling namelists with names that have underscores. Sat Jun 27 17:30:59 EDT 1992: Under -A and -C++, end Main program aliases with "return 0;". Under -A and -C++, use .P files and usage in previous subprograms in the current file to give prototypes for functions declared EXTERNAL but not invoked. Fix memory fault under -d1 -P . Under -A and -C++, cast arguments to the right types in calling a function that has been defined in the current file or in a .P file. Fix bug in handling multi-dimensional arrays with array references in their leading dimensions. Fix bug in the intrinsic cmplx function when the first argument involves an expression for which f2c generates temporary variables, e.g. cmplx(abs(real(a)),1.) . Sat Jul 18 07:36:58 EDT 1992: Fix buglet with -e1c (invisible on most systems) temporary file f2c_functions was unlinked before being closed. libf77: fix bugs in evaluating m**n for integer n < 0 and m an integer different from 1 or a real or double precision 0. Catch SIGTRAP (to print "Trace trap" before aborting). Programs that previously erroneously computed 1 for 0**-1 may now fault. Relevant routines: main.c pow_di.c pow_hh.c pow_ii.c pow_ri.c . Sat Jul 18 08:40:10 EDT 1992: libi77: allow namelist input to end with & (e.g. &end). Thu Jul 23 00:14:43 EDT 1992 Append two underscores rather than one to C keywords used as local variables to avoid conflicts with similarly named COMMON blocks. Thu Jul 23 11:20:55 EDT 1992: libf77, libi77 updated to assume ANSI prototypes unless KR_headers is #defined. libi77 now recognizes a Z format item as in Fortran 90; the implementation assumes 8-bit bytes and botches character strings on little-endian machines (by printing their bytes from right to left): expect this bug to persist; fixing it would require a change to the I/O calling sequences. Tue Jul 28 15:18:33 EDT 1992: libi77: insert missed "#ifdef KR_headers" lines around getnum header in rsne.c. Version not updated. NOTE: "index from f2c" now ends with current timestamps of files in "all from f2c/src", sorted by time. To bring your source up to date, obtain source files with a timestamp later than the time shown in your version.c. Fri Aug 14 08:07:09 EDT 1992: libi77: tweak wrt_E in wref.c to avoid signing NaNs. Sun Aug 23 19:05:22 EDT 1992: fc: supply : after O in getopt invocation (for -O1 -O2 -O3). Mon Aug 24 18:37:59 EDT 1992: Recant above tweak to fc: getopt is dumber than I thought; it's necessary to say -O 1 (etc.). libF77/README: add comments about ABORT, ERF, DERF, ERFC, DERFC, GETARG, GETENV, IARGC, SIGNAL, and SYSTEM. Tue Oct 27 01:57:42 EST 1992: libf77, libi77: 1. Fix botched indirection in signal_.c. 2. Supply missing l_eof = 0 assignment to s_rsne() in rsne.c (so end-of-file on other files won't confuse namelist reads of external files). 3. Prepend f__ to external names that are only of internal interest to lib[FI]77. Thu Oct 29 12:37:18 EST 1992: libf77: Fix botch in signal_.c when KR_headers is #defined; add CFLAGS to makefile. libi77: trivial change to makefile for consistency with libF77/makefile. Wed Feb 3 02:05:16 EST 1993: Recognize types INTEGER*1, LOGICAL*1, LOGICAL*2, INTEGER*8. INTEGER*8 is not well tested and will only work reasonably on systems where int = 4 bytes, long = 8 bytes; on such systems, you'll have to modify f2c.h appropriately, changing integer from long to int and adding typedef long longint. You'll also have to compile libI77 with Allow_TYQUAD #defined and adjust libF77/makefile to compile pow_qq.c. In the f2c source, changes for INTEGER*8 are delimited by #ifdef TYQUAD ... #endif. You can omit the INTEGER*8 changes by compiling with NO_TYQUAD #defined. Otherwise, the new command-line option -!i8 disables recognition of INTEGER*8. libf77: add pow_qq.c libi77: add #ifdef Allow_TYQUAD stuff. Changes for INTEGER*1, LOGICAL*1, and LOGICAL*2 came last 23 July 1992. Fix bug in backspace (that only bit when the last character of the second or subsequent buffer read was the previous newline). Guard against L_tmpnam being too small in endfile.c. For MSDOS, close and reopen files when copying to truncate. Lengthen LINTW (buffer size in lwrite.c). Add \ to the end of #define lines that get broken. Fix bug in handling NAMELIST of items in EQUIVALENCE. Under -h (or -hd), convert Hollerith to integer in general expressions (e.g., assignments), not just when they're passed as arguments, and blank-pad rather than 0-pad the Hollerith to a multiple of sizeof(integer) or sizeof(doublereal). Add command-line option -s, which instructs f2c preserve multi- dimensional subscripts (by emitting and using appropriate #defines). Fix glitch (with default type inferences) in examples like call foo('abc') end subroutine foo(goo) end This gave two warning messages: Warning on line 4 of y.f: inconsistent calling sequences for foo: here 1, previously 2 args and string lengths. Warning on line 4 of y.f: inconsistent calling sequences for foo: here 2, previously 1 args and string lengths. Now the second Warning is suppressed. Complain about all inconsistent arguments, not just the first. Switch to automatic creation of "all from f2c/src". For folks getting f2c source via ftp, this means f2c/src/all.Z is now an empty file rather than a bundle. Separate -P and -A: -P no longer implies -A. Thu Feb 4 00:32:20 EST 1993: Fix some glitches (introduced yesterday) with -h . Fri Feb 5 01:40:38 EST 1993: Fix bug in types conveyed for namelists (introduced 3 Feb. 1993). Fri Feb 5 21:26:43 EST 1993: libi77: tweaks to NAMELIST and open (after comments by Harold Youngren): 1. Reading a ? instead of &name (the start of a namelist) causes the namelist being sought to be written to stdout (unit 6); to omit this feature, compile rsne.c with -DNo_Namelist_Questions. 2. Reading the wrong namelist name now leads to an error message and an attempt to skip input until the right namelist name is found; to omit this feature, compile rsne.c with -DNo_Bad_Namelist_Skip. 3. Namelist writes now insert newlines before each variable; to omit this feature, compile xwsne.c with -DNo_Extra_Namelist_Newlines. 4. For OPEN of sequential files, ACCESS='APPEND' (or access='anything else starting with "A" or "a"') causes the file to be positioned at end-of-file, so a write will append to the file. (This is nonstandard, but does not require modifying data structures.) Mon Feb 8 14:40:37 EST 1993: Increase number of continuation lines allowed from 19 to 99, and allow changing this limit with -NC (e.g. -NC200 for 200 lines). Treat control-Z (at the beginning of a line) as end-of-file: see the new penultimate paragraph of README. Fix a rarely seen glitch that could make an error messages to say "line 0". Tue Feb 9 02:05:40 EST 1993 libi77: change some #ifdef MSDOS lines to #ifdef NON_UNIX_STDIO, and, in err.c under NON_UNIX_STDIO, avoid close(creat(name,0666)) when the unit has another file descriptor for name. Tue Feb 9 17:12:49 EST 1993 libi77: more tweaks for NON_UNIX_STDIO: use stdio routines rather than open, close, creat, seek, fdopen (except for f__isdev). Fri Feb 12 15:49:33 EST 1993 Update src/gram.c (which was forgotten in the recent updates). Most folks regenerate it anyway (wity yacc or bison). Thu Mar 4 17:07:38 EST 1993 Increase default max labels in computed gotos and alternate returns to 257, and allow -Nl1234 to specify this number. Tweak put.c to check p->tag == TADDR in realpart() and imagpart(). Adjust fc script to allow .r (RATFOR) files and -C (check subscripts). Avoid declaring strchr in niceprintf.c under -DANSI_Libraries . gram.c updated again. libi77: err.c, open.c: take declaration of fdopen from rawio.h. Sat Mar 6 07:09:11 EST 1993 libi77: uio.c: adjust off-end-of-record test for sequential unformatted reads to respond to err= rather than end= . Sat Mar 6 16:12:47 EST 1993 Treat scalar arguments of the form (v) and v+0, where v is a variable, as expressions: assign to a temporary variable, and pass the latter. gram.c updated. Mon Mar 8 09:35:38 EST 1993 "f2c.h from f2c" updated to add types logical1 and integer1 for LOGICAL*1 and INTEGER*1. ("f2c.h from f2c" is supposed to be the same as "f2c.h from f2c/src", which was updated 3 Feb. 1993.) Mon Mar 8 17:57:55 EST 1993 Fix rarely seen bug that could cause strange casts in function invocations (revealed by an example with msdos/f2c.exe). msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only). Fri Mar 12 12:37:01 EST 1993 Fix bug with -s in handling subscripts involving min, max, and complicated expressions requiring temporaries. Fix bug in handling COMMONs that need padding by a char array. msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only). Fri Mar 12 17:16:16 EST 1993 libf77, libi77: updated for compiling under C++. Mon Mar 15 16:21:37 EST 1993 libi77: more minor tweaks (for -DKR_headers); Version.c not changed. Thu Mar 18 12:37:30 EST 1993 Flag -r (for discarding carriage-returns on systems that end lines with carriage-return/newline pairs, e.g. PCs) added to xsum, and xsum.c converted to ANSI/ISO syntax (with K&R syntax available with -DKR_headers). [When time permits, the f2c source will undergo a similar conversion.] libi77: tweaks to #includes in endfile.c, err.c, open.c, rawio.h; Version.c not changed. f2c.ps updated (to pick up revision of 2 Feb. 1993 to f2c.1). Fri Mar 19 09:19:26 EST 1993 libi77: add (char *) casts to malloc and realloc invocations in err.c, open.c; Version.c not changed. Tue Mar 30 07:17:15 EST 1993 Fix bug introduced 6 March 1993: possible memory corruption when loops in data statements involve constant subscripts, as in DATA (GUNIT(1,I),I=0,14)/15*-1/ Tue Mar 30 16:17:42 EST 1993 Fix bug with -s: (floating-point array item)*(complex item) generates an _subscr() reference for the floating-point array, but a #define for the _subscr() was omitted. Tue Apr 6 12:11:22 EDT 1993 libi77: adjust error returns for formatted inputs to flush the current input line when err= is specified. To restore the old behavior (input left mid-line), either adjust the #definition of errfl in fio.h or omit the invocation of f__doend in err__fl (in err.c). Tue Apr 6 13:30:04 EDT 1993 Fix bug revealed in subroutine foo(i) call goo(int(i)) end which now passes a copy of i, rather than i itself. Sat Apr 17 11:41:02 EDT 1993 Adjust appending of underscores to conform with f2c.ps ("A Fortran to C Converter"): names that conflict with C keywords or f2c type names now have just one underscore appended (rather than two); add "integer1", "logical1", "longint" to the keyword list. Append underscores to names that appear in EQUIVALENCE and are component names in a structure declared in f2c.h, thus avoiding a problem caused by the #defines emitted for equivalences. Example: complex a equivalence (i,j) a = 1 ! a.i went awry because of #define i j = 2 write(*,*) a, i end Adjust line-breaking logic to avoid splitting very long constants (and names). Example: ! The next line starts with tab and thus is a free-format line. a=.012345689012345689012345689012345689012345689012345689012345689012345689 end Omit extraneous "return 0;" from entry stubs emitted for multiple entry points of type character, complex, or double complex. Sat Apr 17 14:35:05 EDT 1993 Fix bug (introduced 4 Feb.) in separating -P from -A that kept f2c from re-reading a .P file written without -A or -C++ describing a routine with an external argument. [See the just-added note about separating -P from -A in the changes above for 3 Feb. 1993.] Fix bug (type UNKNOWN for V in the example below) revealed by subroutine a() external c call b(c) end subroutine b(v) end Sun Apr 18 19:55:26 EDT 1993 Fix wrong calling sequence for mem() in yesterday's addition to equiv.c . Wed Apr 21 17:39:46 EDT 1993 Fix bug revealed in ASSIGN 10 TO L1 GO TO 20 10 ASSIGN 30 TO L2 STOP 10 20 ASSIGN 10 TO L2 ! Bug here because 10 had been assigned ! to another label, then defined. GO TO L2 30 END Fri Apr 23 18:38:50 EDT 1993 Fix bug with -h revealed in CHARACTER*9 FOO WRITE(FOO,'(I6)') 1 WRITE(FOO,'(I6)') 2 ! struct icilist io___3 botched END Tue Apr 27 16:08:28 EDT 1993 Tweak to makefile: remove "size f2c". Tue May 4 23:48:20 EDT 1993 libf77: tweak signal_ line of f2ch.add . Tue Jun 1 13:47:13 EDT 1993 Fix bug introduced 3 Feb. 1993 in handling multiple entry points with differing return types -- the postfix array in proc.c needed a new entry for integer*8 (which resulted in wrong Multitype suffixes for non-integral types). For (default) K&R C, generate VOID rather than int functions for functions of Fortran type character, complex, and double complex. msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only). Tue Jun 1 23:11:15 EDT 1993 f2c.h: add Multitype component g and commented type longint. proc.c: omit "return 0;" from stubs for complex and double complex entries (when entries have multiple types); add test to avoid memory fault with illegal combinations of entry types. Mon Jun 7 12:00:47 EDT 1993 Fix memory fault in common /c/ m integer m(1) data m(1)/1/, m(2)/2/ ! one too many initializers end msdos/f2cx.exe.Z and msdos/f2c.exe.Z updated (ftp access only). Fri Jun 18 13:55:51 EDT 1993 libi77: change type of signal_ in f2ch.add; change type of il in union Uint from long to integer (for machines like the DEC Alpha, where integer should be the same as int). Version.c not changed. Tweak gram.dcl and gram.head: add semicolons after some rules that lacked them, and remove an extraneous semicolon. These changes are completely transparent to our local yacc programs, but apparently matter on some VMS systems. Wed Jun 23 01:02:56 EDT 1993 Update "fc" shell script, and bring f2c.1 and f2c.1t up to date: they're meant to be linked with (i.e., the same as) src/f2c.1 and src/f2c.1t . [In the last update of f2c.1* (2 Feb. 1993), only src/f2c.1 and src/f2c.1t got changed -- a mistake.] Wed Jun 23 09:04:31 EDT 1993 libi77: fix bug in format reversions for internal writes. Example: character*60 lines(2) write(lines,"('n =',i3,2(' more text',i3))") 3, 4, 5, 6 write(*,*) 'lines(1) = ', lines(1) write(*,*) 'lines(2) = ', lines(2) end gave an error message that began "iio: off end of record", rather than giving the correct output: lines(1) = n = 3 more text 4 more text 5 lines(2) = more text 6 more text Thu Aug 5 11:31:14 EDT 1993 libi77: lread.c: fix bug in handling repetition counts for logical data (during list or namelist input). Change struct f__syl to struct syl (for buggy compilers). Sat Aug 7 16:05:30 EDT 1993 libi77: lread.c (again): fix bug in namelist reading of incomplete logical arrays. Fix minor calling-sequence errors in format.c, output.c, putpcc.c: should be invisible. Mon Aug 9 09:12:38 EDT 1993 Fix erroneous cast under -A in translating character*(*) function getc() getc(2:3)=' ' !wrong cast in first arg to s_copy end libi77: lread.c: fix bug in namelist reading of an incomplete array of numeric data followed by another namelist item whose name starts with 'd', 'D', 'e', or 'E'. Fri Aug 20 13:22:10 EDT 1993 Fix bug in do while revealed by subroutine skdig (line, i) character line*(*), ch*1 integer i logical isdigit isdigit(ch) = ch.ge.'0' .and. ch.le.'9' do while (isdigit(line(i:i))) ! ch__1[0] was set before ! "while(...) {...}" i = i + 1 enddo end Fri Aug 27 08:22:54 EDT 1993 Add #ifdefs to avoid declaring atol when it is a macro; version.c not updated. Wed Sep 8 12:24:26 EDT 1993 libi77: open.c: protect #include "sys/..." with #ifndef NON_UNIX_STDIO; Version date not changed. 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 17:27:54 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. Fix botch introduced 19 Jan 1994: "adjustable dimension on non- argument" messages could cause some things to be freed twice. Tue May 10 07:55:12 EDT 1994 Trivial changes to exec.c, p1output.c, parse_args.c, proc.c, and putpcc.c: change arguments from type foo[] to type *foo for consistency with defs.h. For most compilers, this makes no difference. Thu Jun 2 12:18:18 EDT 1994 Fix bug in handling FORMAT statements that have adjacent character (or Hollerith) strings: an extraneous \002 appeared between the strings. libf77: under -DNO_ONEXIT, arrange for f_exit to be called just once; previously, upon abnormal termination (including stop statements), it was called twice. Mon Jun 6 15:52:57 EDT 1994 libf77: Avoid references to SIGABRT and SIGIOT if neither is defined; Version.c not changed. libi77: Add cast to definition of errfl() in fio.h; this only matters on systems with sizeof(int) < sizeof(long). Under -DNON_UNIX_STDIO, use binary mode for direct formatted files (to avoid any confusion connected with \n characters). Fri Jun 10 16:47:31 EDT 1994 Fix bug under -A in handling unreferenced (and undeclared) external arguments in subroutines with multiple entry points. Example: subroutine m(fcn,futil) external fcn,futil call fcn entry mintio(i1) ! (D_fp)0 rather than (U_fp)0 for futil end Wed Jun 15 10:38:14 EDT 1994 Allow char(constant expression) function in parameter declarations. (This was probably broken in the changes of 29 March 1994.) Fri Jul 1 23:54:00 EDT 1994 Minor adjustments to makefile (rule for f2c.1 commented out) and sysdep.h (#undef KR_headers if __STDC__ is #defined, and base test for ANSI_Libraries and ANSI_Prototypes on KR_headers rather than __STDC__); version.c touched but not changed. libi77: adjust fp.h so local.h is only needed under -DV10; Version.c not changed. Tue Jul 5 03:05:46 EDT 1994 Fix segmentation fault in subroutine foo(a,b,k) data i/1/ double precision a(k,1) ! sequence error: must precede data b = a(i,1) end libi77: Fix bug (introduced 6 June 1994?) in reopening files under NON_UNIX_STDIO. Fix some error messages caused by illegal Fortran. Examples: * 1. x(i) = 0 !Missing declaration for array x call f(x) !Said Impossible storage class 8 in routine mkaddr end !Now says invalid use of statement function x * 2. f = g !No declaration for g; by default it's a real variable call g !Said invalid class code 2 for function g end !Now says g cannot be called * 3. intrinsic foo !Invalid intrinsic name a = foo(b) !Said intrcall: bad intrgroup 0 end !Now just complains about line 1 Tue Jul 5 11:14:26 EDT 1994 Fix glitch in handling erroneous statement function declarations. Example: a(j(i) - i) = a(j(i) - i) + 1 ! bad statement function call foo(a(3)) ! Said Impossible type 0 in routine mktmpn end ! Now warns that i and j are not used Wed Jul 6 17:31:25 EDT 1994 Tweak test for statement functions that (illegally) call themselves; f2c will now proceed to check for other errors, rather than bailing out at the first recursive statement function reference. Warn about but retain divisions by 0 (instead of calling them "compiler errors" and quiting). On IEEE machines, this permits double precision nan, ninf, pinf nan = 0.d0/0.d0 pinf = 1.d0/0.d0 ninf = -1.d0/0.d0 write(*,*) 'nan, pinf, ninf = ', nan, pinf, ninf end to print nan, pinf, ninf = NaN Infinity -Infinity libi77: wref.c: protect with #ifdef GOOD_SPRINTF_EXPONENT an optimization that requires exponents to have 2 digits when 2 digits suffice. lwrite.c wsfe.c (list and formatted external output): omit ' ' carriage-control when compiled with -DOMIT_BLANK_CC . Off-by-one bug fixed in character count for list output of character strings. Omit '.' in list-directed printing of Nan, Infinity. Mon Jul 11 13:05:33 EDT 1994 src/gram.c updated. Tue Jul 12 10:24:42 EDT 1994 libi77: wrtfmt.c: under G11.4, write 0. as " .0000 " rather than " .0000E+00". Thu Jul 14 17:55:46 EDT 1994 Fix glitch in changes of 6 July 1994 that could cause erroneous "division by zero" warnings (or worse). Example: subroutine foo(a,b) y = b a = a / y ! erroneous warning of division by zero end Mon Aug 1 16:45:17 EDT 1994 libi77: lread.c rsne.c: for benefit of systems with a buggy stdio.h, declare ungetc when neither KR_headers nor ungetc is #defined. Version.c not changed. Wed Aug 3 01:53:00 EDT 1994 libi77: lwrite.c (list output): do not insert a newline when appending an oversize item to an empty line. Mon Aug 8 00:51:01 EDT 1994 Fix bug (introduced 3 Feb. 1993) that, under -i2, kept LOGICAL*2 variables from appearing in INQUIRE statements. Under -I2, allow LOGICAL*4 variables to appear in INQUIRE. Fix intrinsic function LEN so it returns a short value under -i2, a long value otherwise. exec.c: fix obscure memory fault possible with bizarre (and highly erroneous) DO-loop syntax. Fri Aug 12 10:45:57 EDT 1994 libi77: fix glitch that kept ERR= (in list- or format-directed input) from working after a NAMELIST READ. Thu Aug 25 13:58:26 EDT 1994 Suppress -s when -C is specified. Give full pathname (netlib@research.att.com) for netlib in readme and src/README. Wed Sep 7 22:13:20 EDT 1994 libi77: typesize.c: adjust to allow types LOGICAL*1, LOGICAL*2, INTEGER*1, and (under -DAllow_TYQUAD) INTEGER*8 in NAMELISTs. Fri Sep 16 17:50:18 EDT 1994 Change name adjustment for reserved words: instead of just appending "_" (a single underscore), append "_a_" to local variable names to avoid trouble when a common block is named a reserved word and the same reserved word is also a local variable name. Example: common /const/ a,b,c real const(3) equivalence (const(1),a) a = 1.234 end Arrange for ichar() to treat characters as unsigned. libf77: s_cmp.c: treat characters as unsigned in comparisons. These changes for unsignedness only matter for strings that contain non-ASCII characters. Now ichar() should always be >= 0. Sat Sep 17 11:19:32 EDT 1994 fc: set rc=$? before exit (to get exit code right in trap code). Mon Sep 19 17:49:43 EDT 1994 libf77: s_paus.c: flush stderr after PAUSE; add #ifdef MSDOS stuff. libi77: README: point out general need for -DMSDOS under MS-DOS. Tue Sep 20 11:42:30 EDT 1994 Fix bug in comparing identically named common blocks, in which all components have the same names and types, but at least one is dimensioned (1) and the other is not dimensioned. Example: subroutine foo common /ab/ a a=1. !!! translated correctly to ab_1.a = (float)1.; end subroutine goo common /ab/ a(1) a(1)=2. !!! translated erroneously to ab_1.a[0] = (float)2. end Tue Sep 27 23:47:34 EDT 1994 Fix bug introduced 16 Sept. 1994: don't add _a_ to C keywords used as external names. In fact, return to earlier behavior of appending __ to C keywords unless they are used as external names, in which case they get just one underscore appended. Adjust constant handling so integer and logical PARAMETERs retain type information, particularly under -I2. Example: SUBROUTINE FOO INTEGER I INTEGER*1 I1 INTEGER*2 I2 INTEGER*4 I4 LOGICAL L LOGICAL*1 L1 LOGICAL*2 L2 LOGICAL*4 L4 PARAMETER (L=.FALSE., L1=.FALSE., L2=.FALSE., L4=.FALSE.) PARAMETER (I=0,I1=0,I2=0,I4=0) CALL DUMMY(I, I1, I2, I4, L, L1, L2, L4) END f2c.1t: Change f\^2c to f2c (omit half-narrow space) in line following ".SH NAME" for benefit of systems that cannot cope with troff commands in this context. Wed Sep 28 12:45:19 EDT 1994 libf77: s_cmp.c fix glitch in -DKR_headers version introduced 12 days ago. Thu Oct 6 09:46:53 EDT 1994 libi77: util.c: omit f__mvgbt (which is never used). f2c.h: change "long" to "long int" to facilitate the adjustments by means of sed described above. Comment out unused typedef of Long. Fri Oct 21 18:02:24 EDT 1994 libf77: add s_catow.c and adjust README to point out that changing "s_cat.o" to "s_catow.o" in the makefile will permit the target of a concatenation to appear on its right-hand side (contrary to the Fortran 77 Standard and at the cost of some run-time efficiency). Wed Nov 2 00:03:58 EST 1994 Adjust -g output to contain only one #line line per statement, inserting \ before the \n ending lines broken because of their length [this insertion was recanted 10 Dec. 1994]. This change accommodates an idiocy in the ANSI/ISO C standard, which leaves undefined the behavior of #line lines that occur within the arguments to a macro call. Wed Nov 2 14:44:27 EST 1994 libi77: under compilation with -DALWAYS_FLUSH, flush buffers at the end of each write statement, and test (via the return from fflush) for write failures, which can be caught with an ERR= specifier in the write statement. This extra flushing slows execution, but can abort execution or alter the flow of control when a disk fills up. f2c/src/io.c: Add ERR= test to e_wsle invocation (end of list-directed external output) to catch write failures when libI77 is compiled with -DALWAYS_FLUSH. Thu Nov 3 10:59:13 EST 1994 Fix bug in handling dimensions involving certain intrinsic functions of constant expressions: the expressions, rather than pointers to them, were passed. Example: subroutine subtest(n,x) real x(2**n,n) ! pow_ii(2,n) was called; now it's pow_ii(&c__2,n) x(2,2)=3. end Tue Nov 8 23:56:30 EST 1994 malloc.c: remove assumption that only malloc calls sbrk. This appears to make malloc.c useful on RS6000 systems. Sun Nov 13 13:09:38 EST 1994 Turn off constant folding of integers used in floating-point expressions, so the assignment in subroutine foo(x) double precision x x = x*1000000*500000 end is rendered as *x = *x * 1000000 * 500000; rather than as *x *= 1783793664; Sat Dec 10 16:31:40 EST 1994 Supply a better error message (than "Impossible type 14") for subroutine foo foo = 3 end Under -g, convey name of included files to #line lines. Recant insertion of \ introduced (under -g) 2 Nov. 1994. Thu Dec 15 14:33:55 EST 1994 New command-line option -Idir specifies directories in which to look for non-absolute include files (after looking in the directory of the current input file). There can be several -Idir options, each specifying one directory. All -Idir options are considered, from left to right, until a suitably named file is found. The -I2 and -I4 command-line options have precedence, so directories named 2 or 4 must be spelled by some circumlocation, such as -I./2 . f2c.ps updated to mention the new -Idir option, correct a typo, and bring the man page at the end up to date. lex.c: fix bug in reading line numbers in #line lines. fc updated to pass -Idir options to f2c. Thu Dec 29 09:48:03 EST 1994 Fix bug (e.g., addressing fault) in diagnosing inconsistency in the type of function eta in the following example: function foo(c1,c2) double complex foo,c1,c2 double precision eta foo = eta(c1,c2) end function eta(c1,c2) double complex eta,c1,c2 eta = c1*c2 end Mon Jan 2 13:27:26 EST 1995 Retain casts for SNGL (or FLOAT) that were erroneously optimized away. Example: subroutine foo(a,b) double precision a,b a = float(b) ! now rendered as *a = (real) (*b); end Use float (rather than double) temporaries in certain expressions of type complex. Example: the temporary for sngl(b) in complex a double precision b a = sngl(b) - (3.,4.) is now of type float. Fri Jan 6 00:00:27 EST 1995 Adjust intrinsic function cmplx to act as dcmplx (returning double complex rather than complex) if either of its args is of type double precision. The double temporaries used prior to 2 Jan. 1995 previously gave it this same behavior. Thu Jan 12 12:31:35 EST 1995 Adjust -krd to use double temporaries in some calculations of type complex. libf77: pow_[dhiqrz][hiq].c: adjust x**i to work on machines that sign-extend right shifts when i is the most negative integer. Wed Jan 25 00:14:42 EST 1995 Fix memory fault in handling overlapping initializations in block data common /zot/ d double precision d(3) character*6 v(4) real r(2) equivalence (d(3),r(1)), (d(1),v(1)) data v/'abcdef', 'ghijkl', 'mnopqr', 'stuvwx'/ data r/4.,5./ end names.c: add "far", "huge", "near" to c_keywords (causing them to have __ appended when used as local variables). libf77: add s_copyow.c, an alternative to s_copy.c for handling (illegal) character assignments where the right- and left-hand sides overlap, as in a(2:4) = a(1:3). Thu Jan 26 14:21:19 EST 1995 libf77: roll s_catow.c and s_copyow.c into s_cat.c and s_copy.c, respectively, allowing the left-hand side of a character assignment to appear on its right-hand side unless s_cat.c and s_copy.c are compiled with -DNO_OVERWRITE (which is a bit more efficient). Fortran 77 forbids the left-hand side from participating in the right-hand side (of a character assignment), but Fortran 90 allows it. libi77: wref.c: fix glitch in printing the exponent of 0 when GOOD_SPRINTF_EXPONENT is not #defined. Fri Jan 27 12:25:41 EST 1995 Under -C++ -ec (or -C++ -e1c), surround struct declarations with #ifdef __cplusplus extern "C" { #endif and #ifdef __cplusplus } #endif (This isn't needed with cfront, but apparently is necessary with some other C++ compilers.) libf77: minor tweak to s_copy.c: copy forward whenever possible (for better cache behavior). Wed Feb 1 10:26:12 EST 1995 Complain about parameter statements that assign values to dummy arguments, as in subroutine foo(x) parameter(x = 3.4) end Sat Feb 4 20:22:02 EST 1995 fc: omit "lib=/lib/num/lib.lo". Wed Feb 8 08:41:14 EST 1995 Minor changes to exec.c, putpcc.c to avoid "bad tag" or "error in frexpr" with certain invalid Fortran. Sat Feb 11 08:57:39 EST 1995 Complain about integer overflows, both in simplifying integer expressions, and in converting integers from decimal to binary. Fix a memory fault in putcx1() associated with invalid input. Thu Feb 23 11:20:59 EST 1995 Omit MAXTOKENLEN; realloc token if necessary (to handle very long strings). Fri Feb 24 11:02:00 EST 1995 libi77: iio.c: z_getc: insert (unsigned char *) to allow internal reading of characters with high-bit set (on machines that sign-extend characters). Tue Mar 14 18:22:42 EST 1995 Fix glitch (in io.c) in handling 0-length strings in format statements, as in write(*,10) 10 format(' ab','','cd') libi77: lread.c and rsfe.c: adjust s_rsle and s_rsfe to check for end-of-file (to prevent infinite loops with empty read statements). Wed Mar 22 10:01:46 EST 1995 f2c.ps: adjust discussion of -P on p. 7 to reflect a change made 3 Feb. 1993: -P no longer implies -A. Fri Apr 21 18:35:00 EDT 1995 fc script: remove absolute paths (since PATH specifies only standard places). On most systems, it's still necessary to adjust the PATH assignment at the start of fc to fit the local conventions. Fri May 26 10:03:17 EDT 1995 fc script: add recognition of -P and .P files. libi77: iio.c: z_wnew: fix bug in handling T format items in internal writes whose last item is written to an earlier position than some previous item. Wed May 31 11:39:48 EDT 1995 libf77: added subroutine exit(rc) (with integer return code rc), which works like a stop statement but supplies rc as the program's return code. Fri Jun 2 11:56:50 EDT 1995 Fix memory fault in parameter (x=2.) data x /2./ end This now elicits two error messages; the second ("too many initializers"), though not desirable, seems hard to eliminate without considerable hassle. Mon Jul 17 23:24:20 EDT 1995 Fix botch in simplifying constants in certain complex expressions. Example: subroutine foo(s,z) double complex z double precision s, M, P parameter ( M = 100.d0, P = 2.d0 ) z = M * M / s * dcmplx (1.d0, P/M) *** The imaginary part of z was miscomputed *** end Under -ext, complain about nonintegral dimensions. Fri Jul 21 11:18:36 EDT 1995 Fix glitch on line 159 of init.c: change "(shortlogical *)0)", to "(shortlogical *)0", This affects multiple entry points when some but not all have arguments of type logical*2. libi77: adjust lwrite.c, wref.c, wrtfmt.c so compiling with -DWANT_LEAD_0 causes formatted writes of floating-point numbers of magnitude < 1 to have an explicit 0 before the decimal point (if the field-width permits it). Note that the Fortran 77 Standard leaves it up to the implementation whether to supply these superfluous zeros. Tue Aug 1 09:25:56 EDT 1995 Permit real (or double precision) parameters in dimension expressions. Mon Aug 7 08:04:00 EDT 1995 Append "_eqv" rather than just "_" to names that that appear in EQUIVALENCE statements as well as structs in f2c.h (to avoid a conflict when these names also name common blocks). Tue Aug 8 12:49:02 EDT 1995 Modify yesterday's change: merge st_fields with c_keywords, to cope with equivalences introduced to permit initializing numeric variables with character data. DATA statements causing these equivalences can appear after executable statements, so the only safe course is to rename all local variable with names in the former st_fields list. This has the unfortunate side effect that the common local variable "i" will henceforth be renamed "i__". Wed Aug 30 00:19:32 EDT 1995 libf77: add F77_aloc, now used in s_cat and system_ (to allocate memory and check for failure in so doing). libi77: improve MSDOS logic in backspace.c. Wed Sep 6 09:06:19 EDT 1995 libf77: Fix return type of system_ (integer) under -DKR_headers. libi77: Move some f_init calls around for people who do not use libF77's main(); now open and namelist read statements that are the first I/O statements executed should work right in that context. Adjust namelist input to treat a subscripted name whose subscripts do not involve colons similarly to the name without a subscript: accept several values, stored in successive elements starting at the indicated subscript. Adjust namelist output to quote character strings (avoiding confusion with arrays of character strings). Thu Sep 7 00:36:04 EDT 1995 Fix glitch in integer*8 exponentiation function: it's pow_qq, not pow_qi. libi77: fix some bugs with -DAllow_TYQUAD (for integer*8); when looking for the &name that starts NAMELIST input, treat lines whose first nonblank character is something other than &, $, or ? as comment lines (i.e., ignore them), unless rsne.c is compiled with -DNo_Namelist_Comments. Thu Sep 7 09:05:40 EDT 1995 libi77: rdfmt.c: one more tweak for -DAllow_TYQUAD. Tue Sep 19 00:03:02 EDT 1995 Adjust handling of floating-point subscript bounds (a questionable f2c extension) so subscripts in the generated C are of integral type. Move #define of roundup to proc.c (where its use is commented out); version.c left at 19950918. Wed Sep 20 17:24:19 EDT 1995 Fix bug in handling ichar() under -h. Thu Oct 5 07:52:56 EDT 1995 libi77: wrtfmt.c: fix bug with t editing (f__cursor was not always zeroed in mv_cur). Tue Oct 10 10:47:54 EDT 1995 Under -ext, warn about X**-Y and X**+Y. Following the original f77, f2c treats these as X**(-Y) and X**(+Y), respectively. (They are not allowed by the official Fortran 77 Standard.) Some Fortran compilers give a bizarre interpretation to larger contexts, making multiplication noncommutative: they treat X**-Y*Z as X**(-Y*Z) rather than X**(-Y)*Z, which, following the rules of Fortran 77, is the same as (X**(-Y))*Z. Wed Oct 11 13:27:05 EDT 1995 libi77: move defs of f__hiwater, f__svic, f__icptr from wrtfmt.c to err.c. This should work around a problem with buggy loaders and sometimes leads to smaller executable programs. Sat Oct 21 23:54:22 EDT 1995 Under -h, fix bug in the treatment of ichar('0') in arithmetic expressions. Demote to -dneg (a new command-line option not mentioned in the man page) imitation of the original f77's treatment of unary minus applied to a REAL operand (yielding a DOUBLE PRECISION result). Previously this imitation (which was present for debugging) occurred under (the default) -!R. It is still suppressed by -R. Tue Nov 7 23:52:57 EST 1995 Adjust assigned GOTOs to honor SAVE declarations. Add comments about ranlib to lib[FI]77/README and makefile. Tue Dec 19 22:54:06 EST 1995 libf77: s_cat.c: fix bug when 2nd or later arg overlaps lhs. Tue Jan 2 17:54:00 EST 1996 libi77: rdfmt.c: move #include "ctype.h" up before "stdlib.h"; no change to Version.c. Sun Feb 25 22:20:20 EST 1996 Adjust expr.c to permit raising the integer constants 1 and -1 to negative constant integral powers. Avoid faulting when -T and -d are not followed by a directory name (immediately, without intervening spaces). Wed Feb 28 12:49:01 EST 1996 Fix a glitch in handling complex parameters assigned a "wrong" type. Example: complex d, z parameter(z = (0d0,0d0)) data d/z/ ! elicited "non-constant initializer" call foo(d) end Thu Feb 29 00:53:12 EST 1996 Fix bug in handling character parameters assigned a char() value. Example: character*2 b,c character*1 esc parameter(esc = char(27)) integer i data (b(i:i),i=1,2)/esc,'a'/ data (c(i:i),i=1,2)/esc,'b'/ ! memory fault call foo(b,c) end Fri Mar 1 23:44:51 EST 1996 Fix glitch in evaluating .EQ. and .NE. when both operands are logical constants (.TRUE. or .FALSE.). Fri Mar 15 17:29:54 EST 1996 libi77: lread.c, rsfe.c: honor END= in READ stmts with empty iolist. Tue Mar 19 23:08:32 EST 1996 lex.c: arrange for a "statement" consisting of a single short bogus keyword to elicit an error message showing the whole keyword. The error message formerly omitted the last letter of the bad keyword. libf77: s_cat.c: supply missing break after overlap detection. Mon May 13 23:35:26 EDT 1996 Recognize Fortran 90's /= as a synonym for .NE.. (<> remains a synonym for .NE..) Emit an empty int function of no arguments to supply an external name to named block data subprograms (so they can be called somewhere to force them to be loaded from a library). Fix bug (memory fault) in handling the following illegal Fortran: parameter(i=1) equivalence(i,j) end Treat cdabs, cdcos, cdexp, cdlog, cdsin, and cdsqrt as synonyms for the double complex intrinsics zabs, zcos, zexp, zlog, zsin, and zsqrt, respectively, unless -cd is specified. Recognize the Fortran 90 bit-manipulation intrinsics btest, iand, ibclr, ibits, ibset, ieor, ior, ishft, and ishftc, unless -i90 is specified. Note that iand, ieor, and ior are thus now synonyms for "and", "xor", and "or", respectively. Add three macros (bit_test, bit_clear, bit_set) to f2c.h for use with btest, ibclr, and ibset, respectively. Add new functions [lq]bit_bits, [lq]bit_shift, and [lq]_bit_cshift to libF77 for use with ibits, ishft, and ishftc, respectively. Add integer function ftell(unit) (returning -1 on error) and subroutine fseek(unit, offset, whence, *) to libI77 (with branch to label * on error). Tue May 14 23:21:12 EDT 1996 Fix glitch (possible memory fault, or worse) in handling multiple entry points with names over 28 characters long. Mon Jun 10 01:20:16 EDT 1996 Update netlib E-mail and ftp addresses in f2c/readme and f2c/src/readme (which are different files) -- to reflect the upcoming breakup of AT&T. libf77: trivial tweaks to F77_aloc.c and system_.c; Version.c not changed. libi77: Adjust rsli.c and lread.c so internal list input with too few items in the input string will honor end= . Mon Jun 10 22:59:57 EDT 1996 Add Bits_per_Byte to sysdep.h and adjust definition of Table_size to depend on Bits_per_Byte (forcing Table_size to be a power of 2); in lex.c, change "comstart[c & 0xfff]" to "comstart[c & (Table_size-1)]" to avoid an out-of-range subscript on end-of-file. Wed Jun 12 00:24:28 EDT 1996 Fix bug in output.c (dereferencing a freed pointer) revealed in print * !np in out_call in output.c clobbered by free end !during out_expr. Wed Jun 19 08:12:47 EDT 1996 f2c.h: add types uinteger, ulongint (for libF77); add qbit_clear and qbit_set macros (in a commented-out section) for integer*8. For integer*8, use qbit_clear and qbit_set for ibclr and ibset. libf77: add casts to unsigned in [lq]bitshft.c. Thu Jun 20 13:30:43 EDT 1996 Complain at character*(*) in common (rather than faulting). Fix bug in recognizing hex constants that start with "16#" (e.g., 16#1234abcd, which is a synonym for z'1234abcd'). Fix bugs in constant folding of expressions involving btest, ibclr, and ibset. Fix bug in constant folding of rshift(16#80000000, -31) (on a 32-bit machine; more generally, the bug was in constant folding of rshift(ibset(0,NBITS-1), 1-NBITS) when f2c runs on a machine with long ints having NBITS bits. Mon Jun 24 07:58:53 EDT 1996 Adjust struct Literal and newlabel() function to accommodate huge source files (with more than 32767 newlabel() invocations). Omit .c file when the .f file has a missing final end statement. Wed Jun 26 14:00:02 EDT 1996 libi77: Add discussion of MXUNIT (highest allowed Fortran unit number) to libI77/README. Fri Jun 28 14:16:11 EDT 1996 Fix glitch with -onetrip: the temporary variable used for nonconstant initial loop variable values was recycled too soon. Example: do i = j+1, k call foo(i+1) ! temp for j+1 was reused here enddo end Tue Jul 2 16:11:27 EDT 1996 formatdata.c: add a 0 to the end of the basetype array (for TYBLANK) (an omission that was harmless on most machines). expr.c: fix a dereference of NULL that was only possible with buggy input, such as subroutine $sub(s) ! the '$' is erroneous character s*(*) s(1:) = ' ' end Sat Jul 6 00:44:56 EDT 1996 Fix glitch in the intrinsic "real" function when applied to a complex (or double complex) variable and passed as an argument to some intrinsic functions. Example: complex a b = sqrt(a) end Fix glitch (only visible if you do not use f2c's malloc and the malloc you do use is defective in the sense that malloc(0) returns 0) in handling include files that end with another include (perhaps followed by comments). Fix glitch with character*(*) arguments named "h" and "i" when the body of the subroutine invokes the intrinsic LEN function. Arrange that after a previous "f2c -P foo.f" has produced foo.P, running "f2c foo.P foo.f" will produce valid C when foo.f contains call sub('1234') end subroutine sub(msg) end Specifically, the length argument in "call sub" is now suppressed. With or without foo.P, it is also now suppressed when the order of subprograms in file foo.f is reversed: subroutine sub(msg) end call sub('1234') end Adjust copyright notices to reflect AT&T breakup. Wed Jul 10 09:25:49 EDT 1996 Fix bug (possible memory fault) in handling erroneously placed and inconsistent declarations. Example that faulted: character*1 w(8) call foo(w) end subroutine foo(m) data h /0.5/ integer m(2) ! should be before data end Fix bug (possible fault) in handling illegal "if" constructions. Example (that faulted): subroutine foo(i,j) if (i) then ! bug: i is integer, not logical else if (j) then ! bug: j is integer, not logical endif end Fix glitch with character*(*) argument named "ret_len" to a character*(*) function. Wed Jul 10 23:04:16 EDT 1996 Fix more glitches in the intrinsic "real" function when applied to a complex (or double complex) variable and passed as an argument to some intrinsic functions. Example: complex a, b r = sqrt(real(conjg(a))) + sqrt(real(a*b)) end Thu Jul 11 17:27:16 EDT 1996 Fix a memory fault associated with complicated, illegal input. Example: subroutine goo character a call foo(a) ! inconsistent with subsequent def and call end subroutine foo(a) end call foo(a) end Wed Jul 17 19:18:28 EDT 1996 Fix yet another case of intrinsic "real" applied to a complex argument. Example: complex a(3) x = sqrt(real(a(2))) ! gave error message about bad tag end Mon Aug 26 11:28:57 EDT 1996 Tweak sysdep.c for non-Unix systems in which process ID's can be over 5 digits long. Tue Aug 27 08:31:32 EDT 1996 Adjust the ishft intrinsic to use unsigned right shifts. (Previously, a negative constant second operand resulted in a possibly signed shift.) Thu Sep 12 14:04:07 EDT 1996 equiv.c: fix glitch with -DKR_headers. libi77: fmtlib.c: fix bug in printing the most negative integer. Fri Sep 13 08:54:40 EDT 1996 Diagnose some illegal appearances of substring notation. Tue Sep 17 17:48:09 EDT 1996 Fix fault in handling some complex parameters. Example: subroutine foo(a) double complex a, b parameter(b = (0,1)) a = b ! f2c faulted here end Thu Sep 26 07:47:10 EDT 1996 libi77: fmt.h: for formatted writes of negative integer*1 values, make ic signed on ANSI systems. If formatted writes of integer*1 values trouble you when using a K&R C compiler, switch to an ANSI compiler or use a compiler flag that makes characters signed. Tue Oct 1 14:41:36 EDT 1996 Give a better error message when dummy arguments appear in data statements. Thu Oct 17 13:37:22 EDT 1996 Fix bug in typechecking arguments to character and complex (or double complex) functions; the bug could cause length arguments for character arguments to be omitted on invocations appearing textually after the first invocation. For example, in subroutine foo character c complex zot call goo(zot(c), zot(c)) end the length was omitted from the second invocation of zot, and there was an erroneous error message about inconsistent calling sequences. Wed Dec 4 13:59:14 EST 1996 Fix bug revealed by subroutine test(cdum,rdum) complex cdum rdum=cos(real(cdum)) ! "Unexpected tag 3 in opconv_fudge" end Fix glitch in parsing "DO 10 D0 = 1, 10". Fix glitch in parsing real*8 x real*8 x ! erroneous "incompatible type" message call foo(x) end Mon Dec 9 23:15:02 EST 1996 Fix glitch in parameter adjustments for arrays whose lower bound depends on a scalar argument. Example: subroutine bug(p,z,m,n) integer z(*),m,n double precision p(z(m):z(m) + n) ! p_offset botched call foo(p(0), p(n)) end libi77: complain about non-positive rec= in direct read and write statements. libf77: trivial adjustments; Version.c not changed. Wed Feb 12 00:18:03 EST 1997 output.c: fix (seldom problematic) glitch in out_call: put parens around the ... in a test of the form "if (q->tag == TADDR && ...)". vax.c: fix bug revealed in the "psi_offset =" assignment in the following example: subroutine foo(psi,m) integer z(100),m common /a/ z double precision psi(z(m):z(m) + 10) call foo(m+1, psi(0),psi(10)) end Mon Feb 24 23:44:54 EST 1997 For consistency with f2c's current treatment of adjacent character strings in FORMAT statements, recognize a Hollerith string following a string (and merge adjacent strings in FORMAT statements). Wed Feb 26 13:41:11 EST 1997 New libf2c.zip, a combination of the libf77 and libi77 bundles (and available only by ftp). libf77: adjust functions with a complex output argument to permit aliasing it with input arguments. (For now, at least, this is just for possible benefit of g77.) libi77: tweak to ftell_.c for systems with strange definitions of SEEK_SET, etc. Tue Apr 8 20:57:08 EDT 1997 libf77: [cz]_div.c: tweaks invisible on most systems (that may improve things slightly with optimized compilation on systems that use gratuitous extra precision). libi77: fmt.c: adjust to complain at missing numbers in formats (but still treat missing ".nnn" as ".0"). Fri Apr 11 14:05:57 EDT 1997 libi77: err.c: attempt to make stderr line buffered rather than fully buffered. (Buffering is needed for format items T and TR.) Thu Apr 17 22:42:43 EDT 1997 libf77: add F77_aloc.o to makefile (and makefile.u in libf2c.zip). Fri Apr 25 19:32:09 EDT 1997 libf77: add [de]time_.c (which may give trouble on some systems). Tue May 27 09:18:52 EDT 1997 libi77: ftell_.c: fix typo that caused the third argument to be treated as 2 on some systems. Mon Jun 9 00:04:37 EDT 1997 libi77 (and libf2c.zip): adjust include order in err.c lread.c wref.c rdfmt.c to include fmt.h (etc.) after system includes. Version.c not changed. Mon Jul 21 16:04:54 EDT 1997 proc.c: fix glitch in logic for "nonpositive dimension" message. libi77: inquire.c: always include string.h (for possible use with -DNON_UNIX_STDIO); Version.c not changed. Thu Jul 24 17:11:23 EDT 1997 Tweak "Notice" to reflect the AT&T breakup -- we missed it when updating the copyright notices in the source files last summer. Adjust src/makefile so malloc.o is not used by default, but can be specified with "make MALLOC=malloc.o". Add comments to src/README about the "CRAY" T3E. Tue Aug 5 14:53:25 EDT 1997 Add definition of calloc to malloc.c; this makes f2c's malloc work on some systems where trouble hitherto arose because references to calloc brought in the system's malloc. (On sensible systems, calloc is defined separately from malloc. To avoid confusion on other systems, f2c/malloc.c now defines calloc.) libi77: lread.c: adjust to accord with a change to the Fortran 8X draft (in 1990 or 1991) that rescinded permission to elide quote marks in namelist input of character data; to get the old behavior, compile with F8X_NML_ELIDE_QUOTES #defined. wrtfmt.o: wrt_G: tweak to print the right number of 0's for zero under G format. Sat Aug 16 05:45:32 EDT 1997 libi77: iio.c: fix bug in internal writes to an array of character strings that sometimes caused one more array element than required by the format to be blank-filled. Example: format(1x). Wed Sep 17 00:39:29 EDT 1997 libi77: fmt.[ch] rdfmt.c wrtfmt.c: tweak struct syl for machines with 64-bit pointers and 32-bit ints that did not 64-bit align struct syl (e.g., Linux on the DEC Alpha). This change should be invisible on other machines. Sun Sep 21 22:05:19 EDT 1997 libf77: [de]time_.c (Unix systems only): change return type to double. Thu Dec 4 22:10:09 EST 1997 Fix bug with handling large blocks of comments (over 4k); parts of the second and subsequent blocks were likely to be lost (not copied into comments in the resulting C). Allow comment lines to be longer before breaking them. Mon Jan 19 17:19:27 EST 1998 makefile: change the rule for making gram.c to one for making gram1.c; henceforth, asking netlib to "send all from f2c/src" will bring you a working gram.c. Nowadays there are simply too many broken versions of yacc floating around. libi77: backspace.c: for b->ufmt==0, change sizeof(int) to sizeof(uiolen). On machines where this would make a difference, it is best for portability to compile libI77 with -DUIOLEN_int, which will render the change invisible. Tue Feb 24 08:35:33 EST 1998 makefile: remove gram.c from the "make clean" rule. Wed Feb 25 08:29:39 EST 1998 makefile: change CFLAGS assignment to -O; add "veryclean" rule. Wed Mar 4 13:13:21 EST 1998 libi77: open.c: fix glitch in comparing file names under -DNON_UNIX_STDIO. Mon Mar 9 23:56:56 EST 1998 putpcc.c: omit an unnecessary temporary variable in computing (expr)**3. libf77, libi77: minor tweaks to make some C++ compilers happy; Version.c not changed. Wed Mar 18 18:08:47 EST 1998 libf77: minor tweaks to [ed]time_.c; Version.c not changed. libi77: endfile.c, open.c: acquire temporary files from tmpfile(), unless compiled with -DNON_ANSI_STDIO, which uses mktemp(). New buffering scheme independent of NON_UNIX_STDIO for handling T format items. Now -DNON_UNIX_STDIO is no longer be necessary for Linux, and libf2c no longer causes stderr to be buffered -- the former setbuf or setvbuf call for stderr was to make T format items work. open.c: use the Posix access() function to check existence or nonexistence of files, except under -DNON_POSIX_STDIO, where trial fopen calls are used. In open.c, fix botch in changes of 19980304. libf2c.zip: the PC makefiles are now set for NT/W95, with comments about changes for DOS. Fri Apr 3 17:22:12 EST 1998 Adjust fix of 19960913 to again permit substring notation on character variables in data statements. Sun Apr 5 19:26:50 EDT 1998 libi77: wsfe.c: make $ format item work: this was lost in the changes of 17 March 1998. Sat May 16 19:08:51 EDT 1998 Adjust output of ftnlen constants: rather than appending L, prepend (ftnlen). This should make the resulting C more portable, e.g., to systems (such as DEC Alpha Unix systems) on which long may be longer than ftnlen. Adjust -r so it also casts REAL expressions passed to intrinsic functions to REAL. Wed May 27 16:02:35 EDT 1998 libf2c.zip: tweak description of compiling libf2c for INTEGER*8 to accord with makefile.u rather than libF77/makefile. Thu May 28 22:45:59 EDT 1998 libi77: backspace.c dfe.c due.c iio.c lread.c rsfe.c sue.c wsfe.c: set f__curunit sooner so various error messages will correctly identify the I/O unit involved. libf2c.zip: above, plus tweaks to PC makefiles: for some purposes, it's still best to compile with -DMSDOS (even for use with NT). Thu Jun 18 01:22:52 EDT 1998 libi77: lread.c: modified so floating-point numbers (containing either a decimal point or an exponent field) are treated as errors when they appear as list input for integer data. Compile lread.c with -DALLOW_FLOAT_IN_INTEGER_LIST_INPUT to restore the old behavior. Mon Aug 31 10:38:54 EDT 1998 formatdata.c: if possible, and assuming doubles must be aligned on double boundaries, use existing holes in DATA for common blocks to force alignment of the block. For example, block data common /abc/ a, b double precision a integer b(2) data b(2)/1/ end used to generate struct { integer fill_1[3]; integer e_2; doublereal e_3; } abc_ = { {0}, 1, 0. }; and now generates struct { doublereal fill_1[1]; integer fill_2[1]; integer e_3; } abc_ = { {0}, {0}, 1 }; In the old generated C, e_3 was added to force alignment; in the new C, fill_1 does this job. Mon Sep 7 19:48:51 EDT 1998 libi77: move e_wdfe from sfe.c to dfe.c, where it was originally. Why did it ever move to sfe.c? Tue Sep 8 10:22:50 EDT 1998 Treat dreal as a synonym for dble unless -cd is specified on the command line. Sun Sep 13 22:23:41 EDT 1998 format.c: fix bug in writing prototypes under f2c -A ... *.P: under some circumstances involving external functions with no known type, a null pointer was passed to printf. Tue Oct 20 23:25:54 EDT 1998 Comments added to libf2c/README and libF77/README, pointing out the need to modify signal1.h on some systems. Wed Feb 10 22:59:52 EST 1999 defs.h lex.c: permit long names (up to at least roughly MAX_SHARPLINE_LEN = 1000 characters long) in #line lines (which only matters under -g). fc: add -U option; recognize .so files. Sat Feb 13 10:18:27 EST 1999 libf2c: endfile.c, lread.c, signal1.h0: minor tweaks to make some (C++) compilers happier; f77_aloc.c: make exit_() visible to C++ compilers. Version strings not changed. Thu Mar 11 23:14:02 EST 1999 Modify f2c (exec.c, expr.c) to diagnose incorrect mixing of types when (f2c extended) intrinsic functions are involved, as in (not(17) .and. 4). Catching this in the first executable statement is a bit tricky, as some checking must be postponed until all statement function declarations have been parsed. Thus there is a chance of today's changes introducing bugs under (let us hope) unusual conditions. Sun Mar 28 13:17:44 EST 1999 lex.c: tweak to get the file name right in error messages caused by statements just after a # nnn "filename" line emitted by the C preprocessor. (The trouble is that the line following the # nnn line must be read to see if it is a continuation of the stuff that preceded the # nnn line.) When # nnn "filename" lines appear among the lines for a Fortran statement, the filename reported in an error message for the statement should now be the file that was current when the first line of the statement was read. Sun May 2 22:38:25 EDT 1999 libf77, libi77, libf2c.zip: make getenv_() more portable (call getenv() rather than knowing about char **environ); adjust some complex intrinsics to work with overlapping arguments (caused by inappropriate use of equivalence); open.c: get "external" versus "internal" right in the error message if a file cannot be opened; err.c: cast a pointer difference to (int) for %d; rdfmt.c: omit fixed-length buffer that could be overwritten by formats Inn or Lnn with nn > 83. Mon May 3 13:14:07 EDT 1999 "Invisible" changes to omit a few compiler warnings in f2c and libf2c; two new casts in libf2c/open.c that matter with 64-bit longs, and one more tweak (libf2c/c_log.c) for pathological equivalences. Minor update to "fc" script: new -L flag and comment correction. Fri Jun 18 02:33:08 EDT 1999 libf2c.zip: rename backspace.c backspac.c, and fix a glitch in it -- b->ufd may change in t_runc(). (For now, it's still backspace.c in the libi77 bundle.) Sun Jun 27 22:05:47 EDT 1999 libf2c.zip, libi77: rsne.c: fix bug in namelist input: a misplaced increment could cause wrong array elements to be assigned; e.g., "&input k(5)=10*1 &end" assigned k(5) and k(15 .. 23).