Path: gmdzi!unido!mcsun!uunet!munnari.oz.au!csc.anu.oz.au!axt654
From: axt...@csc.anu.oz.au
Newsgroups: comp.unix.ultrix
Subject: Another Fortran compiler bug
Message-ID: <1990Nov5.202218.3276@csc.anu.oz.au>
Date: 5 Nov 90 10:22:18 GMT
Organization: Computer Services, Australian National University
Lines: 31
Posted: Mon Nov  5 11:22:18 1990

Here is a Fortran compiler bug along the lines of the C compiler bug talked
about recently. If the following program is run 

	program bug_ger
	real*8 a
	do 10 a=9000.d0,11000.d0,1000.d0
	write(*,999) a,
10	continue
	stop
999	format(G13.5)
	end


then we get
        9000.0   
        1000.
       11000.

The problem is that it can't print the number 10000.0 with the format G13.5.
The real cute thing about this bug though is that it replaces the 0 off the end
of 10000.0 with a NULL. This means that with editors like MicroEmacs the whole
of the rest of the line is wiped, but can be retrieved by converting the NULL
to a zero where necessary (I wrote a C utility to do this - I had a few hundred
data files with 10000.0 in them, or rather not in them....). BTW I am using
Ultrix with f77 linked to fcom2.31.

	I wonder if this bug is related to the C compilers printf bug?

Andrew Tridgell
tri...@aerodec.anu.edu.au