[comp.sys.sun] END of file test in F77 under SUN OS 4

larsa@nada.kth.se (Lars Andersson) (05/06/89)

The typescript included below exhibits an example of what I personally
consider to be nonstandard f77 behaviour. I would call it a bug, but this
is so simple and basic stuff that I can't see how it could leak through
even the most elementary test. 

The point is that the fortran program exhibited below shows different
behaviour under SUN OS 3.5 with the old f77 and under SUN OS 4.0.1 with
the new unbundled f77 compiler (this holds both for sparc and SUN 3
machines). Under 3.5 it behaves in the way that would be expected: the END
test causes normal completion.

This has been run under 3.5 and under SUN OS 4.0.1 with version 1.1 of f77
(according to /usr/lib/lang_info, I don't know the proper way to find out
about the f77 version).

The typescript follows: (spirit is a SUN 4 machine)

Script started on Mon Apr 17 21:52:48 1989
spirit>cat tst.f
      program test
      integer j
      real vektor(10)
100   continue
c         read(*,*,end=900,iostat=ierr,err=800)(vektor(j),j=1,3)
          read(*,*,end=900)(vektor(j),J=1,3)
          write(*,*)'row = ',(vektor(j),J=1,3)
      goto 100
      goto 1000
800   continue
      write(*,*)'error in tst, IERR = ',IERR
      goto 1000
900   CONTINUE
      WRITE(*,*)'tst finished OK'
1000  continue
      END
spirit>f77 -o tst tst.f
tst.f:
 MAIN test:
"tst.f", line 9: Warning: statement cannot be reached
spirit>cat tstin
10.0 20.0 30.0
10.0 20.0 30.0
10.0 20.0 30.0
10.0 20.0 30.0
10.0 20.0 30.0
1.0 2.0 3.0
spirit>cat tstin | tst
row =    10.00000    20.0000    30.0000
row =    10.00000    20.0000    30.0000
row =    10.00000    20.0000    30.0000
row =    10.00000    20.0000    30.0000
row =    10.00000    20.0000    30.0000
row =     1.00000    2.00000    3.00000
list io: [112] incomprehensible list input
logical unit 5, named 'stdin'
lately: reading sequential list external IO
part of last format: ext list io
part of last data: ^?^?^?^?^?^?^?^?^?^?^?^?|
IOT trap
spirit>exit

script done on Mon Apr 17 21:54:07 1989


I would be very grateful for comments on this example, since I need to
solve this to be able to port a large package without doing a lot of mods.

Lars Andersson
Dept. of Math, 
Royal Inst. of Technology
Stockholm

larsa@spirit.nada.kth.se (Lars Andersson) (05/11/89)

In article <891@draken.nada.kth.se> larsa@nada.kth.se (Lars Andersson) writes:
>X-Sun-Spots-Digest: Volume 7, Issue 269, message 10 of 23
>
>The typescript included below exhibits an example of what I personally
>consider to be nonstandard f77 behaviour. I would call it a bug, but this
>is so simple and basic stuff that I can't see how it could leak through
>even the most elementary test. 
 [example program deleted]

Well, after talking to the SUN support people, I got a tape containing no
less than six separate bugfixes, one of which covered the previously
mentioned one. 

It seems to me that news about bugfixes etc should be distributed by
software companies (such as SUN) to license holders, _without_ users
having to prompt the support people for this. 

I would like to know whether this is standard practice.

Lars Andersson

larsa@nada.kth.se

@rice.edu:evan@brazos.rice.edu (Evan Wetstone) (05/11/89)

We had the same problem here.  It's a known bug, and I think its ID is
1011977.  The solution is to call Sun and ask for a Fortran 1.1 patch
tape, or wait for Fortran 1.2 to be delivered.  The patch tape fixes about
six bugs.

Evan Wetstone
Networking and Planning
Rice University, PO Box 1892, Houston TX, 77251-1892

larsa@nada.kth.se (Lars Andersson) (05/11/89)

I got the tape from SUN and the bug is now fixed!  Do you have any idea
when version 1.2 will be out?

Lars