Path: utzoo!attcan!uunet!tut.cis.ohio-state.edu!ucbvax!LERC08.LERC.NASA.GOV!fsfacca From: fsfacca@LERC08.LERC.NASA.GOV (Tony Facca) Newsgroups: comp.sys.sgi Subject: Re: Fortran bug? Message-ID: <8912041758.AA15256@lerc08.lerc.nasa.gov> Date: 4 Dec 89 17:58:58 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 48 Knobi der Rechnerschrat writes: > I discovered the following two bugs in the C and f77 compiler of 3.2. I know >I should report them directly to Calvin Vu, but I've lost his e-mail address. > > First I have the following Fortran Code: > > program test > numatm = -1 > write(*,4711) >4711 format('Next comes the bug',i4) > 1 numatm > end [ I did some editing, but the idea has been preserved ] > > The program compiles fine, but tell me where does is put the continuation >line? To the format statement? That's nonsense? To the write statement? That >would be the meaning, but to late and it doesn't. > The continuation line is just that: a continuation of the FORMAT statement. So, the 4th line of the program is: 4711 format ('Next comes the bug', i4) numatm That much is obvious, right? So, why doesn't the compiler complain? According to the ANSI X3.9-1978 (FORTRAN 77), Section 13.1.2 says: "Character data may follow the right parenthesis that ends the format specification, with no effect on the format specification." Looks like this piece of code conforms to the standard quite nicely. The point about it being nonsense is still debatable. But at least its FORTRAN 77 STANDARD nonsense! :-) Tony Facca & Dan Whipple -- ----------------------------------------------------------------------------- Tony Facca | phone: 216-433-8318 NASA Lewis Research Center | Cleveland, Ohio 44135 | email: fsfacca@lerc08.lerc.nasa.gov -----------------------------------------------------------------------------