Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!gwyn
From: gwyn@brl-tgr.ARPA (Doug Gwyn )
Newsgroups: net.bugs.usg
Subject: libI77 bug
Message-ID: <7514@brl-tgr.ARPA>
Date: Fri, 18-Jan-85 14:29:18 EST
Article-I.D.: brl-tgr.7514
Posted: Fri Jan 18 14:29:18 1985
Date-Received: Sun, 20-Jan-85 05:43:20 EST
Distribution: net
Organization: Ballistic Research Lab
Lines: 30

There is a bug in the F77 I/O library on UNIX System V Release 2.0
(probably also under other versions of the f77 system).

The bug manifests itself as a spurious "err=" exception from a
formatted read from an internal string.  This turns out to be due
to a missing "return 0;" at the end of the z_rnew() function in
source file iio.c.  "lint" does not detect this since the function
is invoked indirectly via a pointer; alas, the strict type-checking
is relaxed for functions that are IMPLICITLY declared result type
(int), for backward compatibility with the days before (void).

The following test program tickles the bug:

      program main
      character arg*11
      arg='100'
      print 400,arg
      read(arg,100,err=4) ll
      print 300,ll
      stop
    4 print 200,arg,ll
      stop 'at err=4'
  100 format(i6)
  200 format(' error, arg=',a,' ll=',i6)
  300 format(' ok, ll=',i6)
  400 format(' start test,arg=',a)
      end

(Actually, the above program ran okay on a PDP-11 but that was just
an accident.  It broke on a VAX.)