Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!udel!haven!umbc3!mbph!hybl From: hybl@mbph.UUCP (Albert Hybl Dept of Biophysics SM) Newsgroups: comp.lang.fortran Subject: Re: Standard conformance Summary: What a beautiful pet peeve! Message-ID: <612@mbph.UUCP> Date: 19 Sep 89 16:05:23 GMT References: <1301@tukki.jyu.fi> Organization: University of Maryland, School of Medicine, Baltimore, MD 21201 Lines: 47 In message <1301@tukki.jyu.fi> from sakkinen@tukki.jyu.fi, Markku Sakkinen, writes >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. It also contains another serious error; the variable I is used in an expression before it is assigned a value. Is that legal in X3.9-1978 fortran or is it just another allowed extension? Are there any implementations that detect this type of error? Why aren't all standard conforming compilers required to detect and report such errors? The following are the results obtained from the 3B2/XLA+ and the 3B1/SVS implementations: From a 3B2/XLA+: No warnings or diagnostics 0 0 1 1 2 4 ... etc etc*etc 10 100 From a 3B1/SVS: MC68000 FORTRAN 77 Compiler V2.2 21-May-84 4. *********** J <=== = I * I ***** Error number 102 in line 4 of file markku.for ***** ***** Illegal jump into block ***** 1 errors. 8 lines. File markku.for ---------------------------------------------------------------------- Albert Hybl, PhD. Office UUCP: uunet!mimsy!mbph!hybl Department of Biophysics Home UUCP: uunet!mimsy!mbph!hybl!ah University of Maryland CoSy: ahybl School of Medicine Baltimore, MD 21201 Phone: (301) 328-7940 (Office) ----------------------------------------------------------------------