🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.2bsd
Article #4

f77 equivalence bug +FIX

#4
From: Steven M. Schultz(Y)
Date: Thu, 29 Jun 1989 00:34
55 lines
1919 bytes
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;

-------------------------------------------------------------------------
Technical Details
Message-ID: <33116@wlbr.IMSD.CONTEL.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!elroy!forsight!jato!mahendo!wlbr!wlv.imsd.contel.com!sms

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!elroy!forsight!jato!mahendo!wlbr!wlv.imsd.contel.com!sms
From: sms@wlv.imsd.contel.com (Steven M. Schultz(Y))
Newsgroups: comp.bugs.2bsd
Subject: f77 equivalence bug +FIX
Keywords: f77 2.10.1BSD fortran
Message-ID: <33116@wlbr.IMSD.CONTEL.COM>
Date: 29 Jun 89 00:34:28 GMT
Sender: news@wlbr.IMSD.CONTEL.COM
Reply-To: sms@wlv.imsd.contel.com (Steven M. Schultz(Y))
Organization: Contel Federal Systems
Lines: 55