Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: sysmark@helios.physics.utoronto.ca (Mark Bartelt)
Subject: forrtl ignores errors from "write(unit,*)"
Date: 1996/02/02	[thread overview]
Message-ID: <DM5JsE.5M7@info.physics.utoronto.ca> (raw)

Is the following a bug, misfeature, or intentional design decision?
Here are three trivial Fortran programs:

-------------------------------------------------------------------
        open(1,name='foo.bar',type='new')
100     write (1,111)
111     format ('hello, world')
        go to 100
        end
-------------------------------------------------------------------
        open(1,name='foo.bar',type='new')
100     write (1,*,err=99) 'hello, world'
        go to 100
99      write (6,*) 'bye'
        end
-------------------------------------------------------------------
        open(1,name='foo.bar',type='new')
100     write (1,*) 'hello, world'
        go to 100
        end
-------------------------------------------------------------------

Suppose, for example, the write() fails because a filesystem is full.
With the first program, the Fortran runtime system catches the error,
and aborts as one would hope:

/home: write failed, file system is full
forrtl: No space left on device
forrtl: severe (38): error during write, unit 1, file /home/sysmark/foo.bar

In the second example, control transfers to the specified "err=" line:

/home: write failed, file system is full
 bye

But in the third example, the program loops forever, emitting zillions
of "/home: write failed, file system is full" messages.

Oughtn't an error in a "write(unit,*)" statement, where no "err=" has
been specified, cause an abort in the same manner as "write(unit,fmt)"
does?

"DEC Fortran V3.8 for OSF/1 AXP Systems" is the version we're running.

Mark Bartelt                                             416/978-5619
Canadian Institute for                          mark@cita.toronto.edu
Theoretical Astrophysics                        mark@cita.utoronto.ca

"Nur eine Waffel taugt!"      --      Parsifal, in an Eggo commercial



             reply	other threads:[~1996-02-02  5:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-02  5:00 Mark Bartelt [this message]
1996-02-05  5:00 ` forrtl ignores errors from "write(unit,*)" Steve Lionel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox