g77 ? why conflicting REC= and END= in read ?

Peter Teuben teuben@astro.umd.edu
Tue Oct 20 15:12:00 GMT 1998


Why would g77 flag the following code as wrong:

        program try
        integer i,j
        open(11,file='junk',access='direct',form='unformatted',
     *          status='old',recl=8)

        do 100 i=1,10
            read(11,rec=i,end=800, err=999) j
  100   continue
  800   continue
  999   continue

        end


% g77 -c try.f
try.f: In program `try':
try.f:7: 
               read(11,rec=i,end=800, err=999) j
                       1     2
Conflicting I/O control specifications at (1) and (2)


(and btw, the presence of the err= is not important, but for historic (?)
reasons this code needs both err= and end=.
I looked over the ANSI manual, can't find any restrictions on  the
combined use of END= and REC=, and the code compiles fine on a variety
of other compilers.


 peter




More information about the Gcc-bugs mailing list