Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help] Maybe a bug that will affect stdlib_io:open: open files with access=stream in gfortran. #532

Open
zoziha opened this issue Sep 19, 2021 · 1 comment · May be fixed by #958
Open
Labels
bug Something isn't working compiler: gfortran Specific to GCC Fortran compiler

Comments

@zoziha
Copy link
Contributor

zoziha commented Sep 19, 2021

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

8bfcdf9

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?

@zoziha zoziha added the bug Something isn't working label Sep 19, 2021
@awvwgk
Copy link
Member

awvwgk commented Sep 19, 2021

See https://gcc.gnu.org/bugs/ for details on reporting bugs to GCC. You can create an account at https://gcc.gnu.org/bugzilla/ to file the actual bugreport or reach out to the developers on the mailing list: https://gcc.gnu.org/mailman/listinfo/fortran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler: gfortran Specific to GCC Fortran compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants