[Bug fortran/84506] INQUIRE(pos=) always sets pos=0 with -fdefault-integer-8
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Thu Feb 22 00:20:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84506
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
The problem is related to UNIT.
program TestInquire
implicit none
integer(4) :: iUnit
integer(8) :: iPos
open(newunit=iunit, file='output.txt', access='stream', status='replace')
write(iUnit) 'TEXT'
inquire(iUnit, pos=iPos)
print *, iPos
end program TestInquire
The above gives the expected result.
program TestInquire
implicit none
integer(8) :: iUnit
integer(8) :: iPos
open(newunit=iunit, file='output.txt', access='stream', status='replace')
write(iUnit) 'TEXT'
inquire(iUnit, pos=iPos)
print *, iPos
end program TestInquire
This gives the wrong result.
More information about the Gcc-bugs
mailing list