Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!beta!a!jkw From: jkw@a.UUCP (Jay Wooten) Newsgroups: comp.lang.fortran Subject: Re: Compiler confusion between functions and subroutines. Message-ID: <306@a.UUCP> Date: Fri, 2-Oct-87 16:26:08 EDT Article-I.D.: a.306 Posted: Fri Oct 2 16:26:08 1987 Date-Received: Tue, 6-Oct-87 05:42:10 EDT Organization: Los Alamos Natl Lab, Los Alamos, N.M. Lines: 90 Keywords: Microsoft FORTRAN for Mac., UTAH FORTRAN Summary: other systems In article <5288@jade.BERKELEY.EDU>, lagache@violet.berkeley.edu (Edouard Lagache) writes: > > > Hello FORTRAN hackers everywhere! > > Right on the heals of my recent report of "interesting" > parsing by 'f77', I have a lulu for you. Yesterday a student > came to me with a very interesting program which had the same > character as the following: > > INTEGER I,J,SQUARE > I=4 > CALL SQUARE(I,J) > PRINT *,I,J > STOP > END > > INTEGER FUNCTION SQUARE(I,J) > INTEGER I,J > J = I**2 > RETURN > END > > Impossible? Worse than that, it worked! The fellow > said that he was using version 2 of MS-FORTRAN for the Mac. > A quick check of the FORTRANs that I could look at gives the > following tally: > > UTAH FORTRAN accepts the code and it runs "correctly" > > MS-FORTRAN 3.X for PC and f77 finds the error. > > I wonder how many compilers out there are guilty of this > affliction? > > > Edouard Lagache > School of Education > U.C. Berkeley > lagache@violet.berkeley.edu BSD 4.3 : "Declaration error for square: incompatable type declarations" VMS 4.5 : Accepts the code and it runs "correctly" pad pad pad