Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!ginosko!uunet!mcsun!sunic!tut!tukki!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.fortran Subject: Standard conformance Message-ID: <1301@tukki.jyu.fi> Date: 14 Sep 89 10:37:15 GMT Reply-To: markku@jytko.jyu.fi (Markku Sakkinen) SAKKINEN@FINJYU.bitnet (alternative) Organization: University of Jyvaskyla, Finland Lines: 45 The Fortran-77 standard _was_ accepted 11 years ago, so one would suppose that the compiler writers have already taken notice. 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 It contains a GOTO into a DO loop, which is illegal in Fortran-77. Furthermore, very trivial static analysis could detect that the GOTO here cannot be legal even according to the "extended range" rules of Fortran-66. 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. Jumping into a DO loop can easily happen as a kind of clerical error, especially when old code is reworked. It can also cause puzzling run-time effects so that it is difficult to find the original error. Therefore detecting this error at compile time is very useful: compilers should do their job! The above-mentioned omission also makes one pessimistic about how long even the most Fortran-oriented computer vendors will take to really implement any Fortran-8X (or 9X?) standard, even if such a standard becomes official. Note: it was years ago that I last had to work with Fortran; I just took up an old pet peeve. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland