f77 equivalence bug +FIX
Steven M. SchultzY
sms at wlv.imsd.contel.com
Thu Jun 29 10:34:28 AEST 1989
Subject: bug in f77 equivalence handling
Index: usr.bin/f77/equiv.c 2.10BSD
Description:
/lib/f77pass1 gives "bad alignment forced by equivalence" error
on many equivalence statements.
Repeat-By:
Try to compile this program with f77:
program test
real a(2),a1,a2
equivalence (a(1),a1),(a(2),a2)
end
Note the errors produced for all variables mentioned in the
equivalence statement.
Fix:
It's yet another long vs. int gotcha, the lmin() and lmax()
functions were not declared properly in eqveqv().
Apply the following patch to equiv.c:
*** equiv.c.old Tue Jun 27 19:57:21 1989
--- equiv.c Tue Jun 27 19:54:24 1989
***************
*** 1,6 ****
--- 1,7 ----
#include "defs"
#include "string_defs"
+ extern ftnint iarrlen(), lmin(), lmax();
/* ROUTINES RELATED TO EQUIVALENCE CLASS PROCESSING */
/* called at end of declarations section to process chains
***************
*** 10,16 ****
{
register int i;
int inequiv, comno, ovarno;
! ftnint comoffset, offset, leng, iarrlen(), lmin(), lmax();
register struct equivblock *p;
register struct eqvchain *q;
struct primblock *itemp;
--- 11,17 ----
{
register int i;
int inequiv, comno, ovarno;
! ftnint comoffset, offset, leng;
register struct equivblock *p;
register struct eqvchain *q;
struct primblock *itemp;
-------------------------------------------------------------------------
More information about the Comp.bugs.2bsd
mailing list