weird f77 bug; anyone seen this one?

R. Curtis Jackson rcj at burl.UUCP
Sat May 5 00:53:08 AEST 1984


We are running USG 5.0 on a VAX 11/780.  Here is part of a subroutine
from an f77 program that compiles properly:

	subroutine scale (buff2,f2,ctscl2,type2)

	character buff2*132,cont2*2,type2*4
	integer a2,d,e2,f2,ctscl2

	cont2 = ' 	'
	a2 = index (buff2,'scale')
	if (a2 .ne. 0) then
	  do 100 d = a2+5,len(buff2)
	    if (f2 .eq. 1) goto 200
	     if ((buff2(d,d) .eq. ' ') .or.(buff2(d,d) .eq. '	'))
     &		go to 100
	     e2=d
	     f2=1
	     go to 100
200	    if ((buff2(d,d) .ne. ' ') .or. (buff2(d,d) .ne. '	'))
     &		go to 100
c	    i = strtok (ctscl2,buff2,cont2,'i')
100	  continue
	endif


If, however, you change the name of the variable 'd' to 'd2' throughout,
the compiler flags a syntax error on the 'do 100 ...' statement.

Any guesses?
-- 

The MAD Programmer -- 919-228-3313 (Cornet 291)
alias: Curtis Jackson	...![ ihnp4 ulysses cbosgd clyde ]!burl!rcj



More information about the Comp.unix.wizards mailing list