[Bug libfortran/124668] STOP statement should probably flush OUTPUT_UNIT before issuing its message on ERROR_UNIT

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 27 19:49:26 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124668

Steve Kargl <kargl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #5 from Steve Kargl <kargl at gcc dot gnu.org> ---
(In reply to anlauf from comment #3)
> It looks like the STOP output goes to stderr, the write to stdout.
> 
> Similarly for ERROR STOP & traceback.
> 
> Is it really a gfortran problem?

IMO, no.  This is an expected behavior 
in that writing to one unit over any other
unit is not required to be synchronized.
Unfortunately, the backing device for
stdout and stderr is the same device.

Note, the behavior can be altered via
environmental variables.

* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units
* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.


More information about the Gcc-bugs mailing list