- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
The following code
module tvmod
use ISO_FORTRAN_ENV
implicit none
private
save
type, public :: tv
integer(int64) :: tv_secs = 0
integer(int64) :: tv_nsecs = 0
contains
procedure :: write_formatted
generic :: write(formatted) => write_formatted
end type
contains
subroutine write_formatted(this, unit, iotype, v_list, iostat, iomsg)
class(tv), intent(in) :: this
integer, intent(in) :: unit
character(*), intent(in) :: iotype
integer, intent(in) :: v_list(:)
integer, intent(out) :: iostat
character(*), intent(inout) :: iomsg
write (unit, *, IOSTAT = iostat, IOMSG = iomsg) this%tv_secs, this%tv_nsecs
end subroutine
end module tvmod
use tvmod
implicit none
character(63) :: list, dt
type(tv) :: v
v = tv(15, 16)
write (list, *) v
write (dt, '(dt)') v
print*,'values='
print*,'list=', trim(list)
print*,'dt=', trim(dt)
end
Is supposed to write ' 15 16' into an internal file regardless of whether the '(dt)' format expression is used or not.
For list-directed write it works, but when the '(dt)' format is used, the first number sort of leaks into stdout (i.e., the output_unit), as shown by the following:
$ ifx -V dt-io-test.f90 && ./a.out
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.0.2 Build 20231213
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.
Intel(R) Fortran 24.0-1238.2
GNU ld (GNU Binutils for Debian) 2.42
15 values=
list= 15 16
dt= 16
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jwmwalrus, thank you for reporting this and for the great reproducer. I filed a bug report, CMPLRLLVM-57003. We'll let you know when the fix is available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jwmwalrus, look for the fix for this mangled output in ifx 2024.2.0 that will be released in mid-2024.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page