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

--- Comment #5 from max.pd at gmx dot de ---
The -fdec compiler flag provides a possible work around. When opening a Unit
with CARRIAGECONTROL='NONE' (an option available with DEC extensions in
gfortran), the program won't show the unexpected behavior any more. But there
would be no way to enable the carriage return between records for that io-unit
omitting '$' in the format expression. This work around makes it necessary to
open a new unit for stdout output:

       OPEN (UNIT=7, FILE='/dev/stdout', CARRIAGECONTROL='NONE')

 This feature is documented in:

https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gfortran/Extended-I_002fO-specifiers.html

The '$'-fin format works well for gfortran on single records without any
compiler flags. So it might be coherent, to make a patch, that affects the full
scope of the '$' format expressions, even those compiled without the -fdec
compiler flags. So the patch would cover all possible occurrences of the
unexpected behavior when writing multiple record output.

Reply via email to