Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!sunic!luth!puff!palle From: palle@dc.luth.se (Bertil P}lsson) Newsgroups: comp.lang.fortran Subject: Re: Standard conformance Message-ID: <850@puff.luth.se> Date: 16 Sep 89 13:49:18 GMT References: <1301@tukki.jyu.fi> Sender: Bertil P}lsson Reply-To: Bertil P}lsson Organization: University of Lulea, Sweden Lines: 54 UUCP-Path: {uunet,mcvax}!enea!puff.luth.se!palle In <1301@tukki.jyu.fi> markku@jytko.jyu.fi (Markku Sakkinen) writes > Well... take this very simple example of an > _incorrect_ Fortran programme: > INTEGER I, J > IF (I .LT. 100000) GOTO 2 > DO 9 I = 1, 10 > 2 J = I * I > WRITE (6, 100) I, J > 9 CONTINUE > 100 FORMAT (2I12) > END (Text deleted) > I just tried this kind of example once again with Digital's VAX/VMS > Fortran compiler, turning on all possible STANDARD and WARNING switches > (I should think). The result: it compiled without the slightest complaint. > Then I tried the same with Sun's Fortran 77 compiler (with the -ansi > option), and it behaved likewise. The current Norsk Data (ND) Fortran-compiler gives the following result, which I think is quite reasonable; a warning at compile time. Of course, if you neglect the warning you get an unpredictable result. f-5 illegal:for ND-500 ANSI 77 FORTRAN COMPILER - 210190K02 COMPILING: #MAIN LINE: 1 ** WARNING ** #MAIN 2: ' 2', BRANCH INTO DO/IF NEST - CPU TIME USED: 0.3 SECONDS. 8 LINES COMPILED. *** 1 WARNING - PROGRAM SIZE=83 DATA SIZE=120 COMMON SIZE=0 0 0 1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64 9 81 10 100 I also compiled and ran the program with Microsoft Fortran 4.1 on a PC/AT-clone. It also gives a warning, and produces the same output as for the ND compiler. Bertil Paulsson ! Internet : palle@mop.luth.se Division of Mineral Processing ! UUCP: ..{uunet,mcvax}!enea!mop.luth.se!palle Lulea University of Technology ! BITNET : palle%mop.luth.se@sekth S-951 87 LULEA ! Fax : +46-920-91199 Sweden ! Telex : 80447 LUH S