Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gfortran bug for string_type UDDTIO? #354

Open
Labels
bugSomething isn't working compiler: gfortranSpecific to GCC Fortran compiler topic: stringsString processing
@LKedward

Description

I have the following simple program that writes three lines to a file and then reads the same three lines using string_type UDDTIO:

module test_mod
use stdlib_string_type
implicit none
contains
subroutine write_file()
 integer :: fh
 open(newunit=fh,file="scratch.txt",status="unknown")
 write(fh,*) 'This is line one'
 write(fh,*) 'This is line two'
 write(fh,*) 'This is line three'
 close(fh)
end subroutine write_file
subroutine read_file()
 
 integer :: fh, ios
 type(string_type) :: line
 open(newunit=fh,file="scratch.txt",status="unknown")
 do
 read(fh,*,iostat=ios) line
 if (ios /= 0) exit
 write(*,*) line
 end do
 close(fh)
end subroutine read_file
end module test_mod
program test
 use test_mod
 implicit none
 call write_file()
 call read_file()
end program test

With gfortran (10.1.0) only the first line is printed back, whereas Intel fortran (2021年1月2日) prints all three lines.
Is this a bug in stdlib_string_type, a bug in gfortran UDDTIO, or have I done something wrong with my use of string_type?

(I'm using the stdlib-fpm package which is at stdlib commit b522bbb).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working compiler: gfortranSpecific to GCC Fortran compiler topic: stringsString processing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /