[libgfortran,patch] Flush open units before SYSTEM call

François-Xavier Coudert fxcoudert@gmail.com
Mon May 7 10:37:00 GMT 2007


Attached patch fixes PR31607 ("CALL SYSTEM produces garbled output
when writing to a buffered file") by flushing all open units before
performing a SYSTEM call (the call is done in the library routine for
SYSTEM). This ensures that the output from the SYSTEM call is not
mixed with other output, consistently with the behaviour of other
compilers (Intel, Sun, g95 to name a few).

Bootstrapped and regtested on i686-linux, OK for mainline?

FX


:ADDPATCH libgfortran:

2007-05-07  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        * intrinsics/system.c (system_sub): Call flush_all_units.
        * io/io.h (flush_all_units): Move prototype to libgfortran.h.
        * libgfortran.h (flush_all_units): Add prototype.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: system_flush.diff
Type: text/x-patch
Size: 1297 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070507/e675c410/attachment.bin>


More information about the Gcc-patches mailing list