[Bug fortran/80009] Printing/writing a structure with a real edit descriptor.
walt.brainerd at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Mar 12 16:02:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80009
--- Comment #4 from Walt Brainerd <walt.brainerd at gmail dot com> ---
Sorry, I cut the example down one step too many.
Please try this one. It works OK without all the stuff
related to DTIO.
BTW, I didn't mention: this is on Windows 10.
module B_write_dt_mod
implicit none
private
type, public :: B_type
real :: amount
end type B_type
interface write (formatted)
procedure :: Write_b_real
end interface
public :: write (formatted)
contains
subroutine Write_b_real &
(amount, unit, b_edit_descriptor, v_list, iostat, iomsg)
class (B_type), intent(in) :: amount
integer, intent(in) :: unit
character (len=*), intent(in) :: b_edit_descriptor
integer, dimension(:), intent(in) :: v_list
integer, intent(out) :: iostat
character (len=*), intent(inout) :: iomsg
write (unit=unit, fmt="(a)", iostat=iostat) "444.44"
end subroutine Write_b_real
end module B_write_dt_mod
program test_b_write_dt_mod
use :: B_write_dt_mod
implicit none
write (unit=*, fmt="(f4.1)") B_type(20.0)
end program test_b_write_dt_mod
More information about the Gcc-bugs
mailing list