Closed
Description
Description
The following example can get our expected results on ifort
, but in the case of gfortran with access=stream
, for the characters in the output example (A10>A2
), unexpected encoding will occur!
This may affect the use of the open
function in stdlib_io
with gfortran, which uses access=stream
.
Demo: Characters output
program main
open (2, file="2.txt", access="stream", form="formatted")
write(2, "(2A10)") "12","34"
close(2)
open (3, file="3.txt", access="sequential", form="formatted")
write(3, "(2A10)") "12","34"
close(3)
end program main
Run results on my laptop (windows10, msys2 ucrt64-gfortran 10.3)
2.txt
12343.txts 343.txtseq
3.txt
12 34
Expected Behaviour
In the above example, I think access
should output consistent results in both sequential
and stream
cases. ifort
is like this, gfortran unexpectedly garbled when access=stream
.
Version of stdlib
Platform and Architecture
Windows 10, msys2 ucrt64-gfortran 10.3
Additional Information
I think this should be a bug. If so, do we need to report to gfortran?