🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.f77
Article #291

Re: Minor I/O bug (and my favorite f77 I/O bug)

#291
From: Daniel R. Levy
Date: Tue, 07 Jan 1986 09:57
42 lines
2435 bytes
In article <670@ttrdc.UUCP>, levy@ttrdc.UUCP (That's me) writes:
>
>But yes it is a bug.
>
>My favorite I/O bug is
>
>      character*10 buf
>      integer num
>      buf = '12'
>      read(buf,'(I2)',err=20) num
>      write(6,*)num
>      stop
>20    write(6,*)'Error!',num
>      stop
>      end
>
>The output will be
>
>Error! 12

First, I may owe a retraction on the first statement.  I got mail from someone
who seemed to know what they were talking about that allowed that (-1) as an
output list expression might violate some obscure rule of the Fortran 77
standard (I don't have that venerable document handy so I can't check whether
this is kosher or not, though it escapes me why one would WANT to put a lonely
constant or even variable within parens and call that an expression).  If it
IS a violation, than f77, of course, is well within its rights to barf at this
"expression."

Second, the same mail pointed out to me that the second example worked fine
under BSD 4.3.  I will not dispute that since I do not have a 4.3 system handy
to test with (it does barf on 4.2 and earlier, and on the Sys5r2 and earlier
f77's that I have had a chance to try).  I still would like to know if the
fault lay in the library or in the compiled code that called it, and how it
could be patched if it were feasible in the 4.2 (or better, the Sys5) version.
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!ihnp4!ttrdc!levy
Technical Details
Message-ID: <672@ttrdc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!ltuxa!ttrdc!levy
References: <3117@sdcc3.UUCP> <247@xanth.UUCP> <115@sdcsmb.UUCP> <670@ttrdc.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ttrdc.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!ltuxa!ttrdc!levy
From: levy@ttrdc.UUCP (Daniel R. Levy)
Newsgroups: net.lang.f77
Subject: Re: Minor I/O bug (and my favorite f77 I/O bug)
Message-ID: <672@ttrdc.UUCP>
Date: Tue, 7-Jan-86 04:57:55 EST
Article-I.D.: ttrdc.672
Posted: Tue Jan  7 04:57:55 1986
Date-Received: Wed, 8-Jan-86 08:30:53 EST
References: <3117@sdcc3.UUCP> <247@xanth.UUCP> <115@sdcsmb.UUCP> <670@ttrdc.UUCP>
Organization: AT&T, Computer Systems Division, Skokie, IL
Lines: 42