Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ogcvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!eagle!harpo!ihnp4!zehntel!hplabs!tektronix!ogcvax!root From: root@ogcvax.UUCP (Bruce Jerrick) Newsgroups: net.bugs.4bsd Subject: "struct" program mishandles computed GOTO's Message-ID: <383@ogcvax.UUCP> Date: Wed, 11-Apr-84 04:37:36 EST Article-I.D.: ogcvax.383 Posted: Wed Apr 11 04:37:36 1984 Date-Received: Fri, 13-Apr-84 08:28:46 EST Organization: Oregon Graduate Center, Beaverton, OR Lines: 50 Subject: "struct" mishandles computed GOTO's Index: usr.bin/struct/* 4.2BSD Description: "struct" will not properly handle a computed GOTO if the comma following the label list (...) isn't there. That comma is optional according to Fortran. Repeat-By: Put the program between "----" below into file "bug.f". Verify that it will go through "struct" correctly as is by doing: % struct bug.f (with or without "-s" flag; results are the same). Then change the computed GOTO from: GOTO (10,20), I to: GOTO (10,20) I and repeat "struct" command. There will be messages about unreachable statements, and output will be incorrect. ------------------------------------------------------------ PROGRAM BUG C "struct" will not properly handle the computed GOTO if C the comma following the label list (...) isn't there. C That comma is optional according to Fortran. I=2 GOTO (10,20), I 10 WRITE(6,100) GOTO 90 20 WRITE(6,200) GOTO 90 90 WRITE(6,900) STOP 100 FORMAT(' STATEMENT 10') 200 FORMAT(' STATEMENT 20') 900 FORMAT(' STATEMENT 90') END ------------------------------------------------------------ -- Bruce Jerrick Oregon Graduate Center