Go to the first, previous, next, last section, table of contents.


Always Flush Output

Some Fortran programs require output (writes) to be flushed to the operating system (under UNIX, via the fflush() library call) so that errors, such as disk full, are immediately flagged via the relevant ERR= and IOSTAT= mechanism, instead of such errors being flagged later as subsequent writes occur, forcing the previously written data to disk, or when the file is closed.

Essentially, the difference can be viewed as synchronous error reporting (immediate flagging of errors during writes) versus asynchronous, or, more precisely, buffered error reporting (detection of errors might be delayed).

libg2c supports flagging write errors immediately when it is built with the `ALWAYS_FLUSH' macro defined. This results in a libg2c that runs slower, sometimes quite a bit slower, under certain circumstances--for example, accessing files via the networked file system NFS--but the effect can be more reliable, robust file I/O.

If you know that Fortran programs requiring this level of precision of error reporting are to be compiled using the version of g77 you are building, you might wish to modify the g77 source tree so that the version of libg2c is built with the `ALWAYS_FLUSH' macro defined, enabling this behavior.

To do this, find this line in `f/runtime/f2c.h' in your g77 source tree:

/* #define ALWAYS_FLUSH */

Remove the leading `/* ', so the line begins with `#define', and the trailing ` */'.

Then build or rebuild g77 as appropriate.


Go to the first, previous, next, last section, table of contents.