[comp.lang.fortran] A bug that was caught by all of the fortran compilers EXCEPT f77

ao@cevax.berkeley.edu (A Ozselcuk) (01/30/88)

f77 does not catch the error in the following code

	program foo2
	integer i, j, a(10,10)
	do 20 i = 1, 10
	    do 10 j = 1,10
	    i = i +1
		a(i,j) = 0
10	    continue
20	continue
        stop
	end


The following compilers catch the error:

ULTRIX fort  ( Based on DEC-VAX VMS Fortran )

WATFOR77  (on IBM 3090)

FORTVS or FORT22   (IBM`s own compilers on 3090)

However f77 catches the following error:


	program foo
	integer i, j, a(10,10)
	do 20 i = 1, 10
	    i = i +1
	    do 10 j = 1,10
		a(i,j) = 0
10	    continue
20	continue
        stop
	end

and gets a standing ovation from me.
If you want to flame, please DO NOT SEND IT THROUGH THE NEWS,
e-mail will suffice.


Akin Ozselcuk                        Experientia Docet
ao@cevax.berkeley.edu                "We Learn From Disasters "
					     motto of the Bridge Engineers