- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When using a repeat count for the DT edit descriptor, a read statement crashes:
module m_test type t1 integer :: a contains procedure, private :: r_t1 generic :: read(formatted) => r_t1 end type contains subroutine r_t1(dtv, unit, iotype, vlist, iostat, iomsg) class(t1), intent(inout) :: dtv integer, intent(in) :: unit character(len=*), intent(in) :: iotype integer, intent(in) :: vlist(:) integer, intent(out) :: iostat character(len=*), intent(inout) :: iomsg read(unit, fmt="(i4)", iostat=iostat, iomsg=iomsg) dtv%a end subroutine end module program test use m_test character(len=:), allocatable :: str type(t1) :: x,y,z integer :: i,j,k str="111122223333444455555" read(str, fmt="(3i4)") i,j,k print *, i,j,k read(str, fmt="(DT,DT,DT)") x,y,z print *, x%a, y%a, z%a read(str, fmt="(3DT)") x,y,z print *, x%a, y%a, z%a end program
C:\TEMP>ifort test.f90 /standard-semantics Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.4.221 Build 20150407 Copyright (C) 1985-2015 Intel Corporation. All rights reserved. Microsoft (R) Incremental Linker Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved. -out:test.exe -subsystem:console test.obj C:\TEMP>test 1111 2222 3333 1111 2222 3333 forrtl: severe (24): end-of-file during read, unit -5, file Internal Formatted Read Image PC Routine Line Source test.exe 00007FF7A26AACC9 Unknown Unknown Unknown test.exe 00007FF7A26974C3 Unknown Unknown Unknown test.exe 00007FF7A26916BC Unknown Unknown Unknown test.exe 00007FF7A270021E Unknown Unknown Unknown test.exe 00007FF7A26E9494 Unknown Unknown Unknown KERNEL32.DLL 00007FF9814816AD Unknown Unknown Unknown ntdll.dll 00007FF982BC34A5 Unknown Unknown Unknown C:\TEMP>
I cannot see an exception in the standard (Fortran 2008) forbidding the use of a repeat count with the DT edit descriptor. I tried some variants like 3(DT), 3(DT(1)), 3DT'x', they all fail.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can see the failure in 15.0.4 but not in 16.0.0, which is available now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
I asked IT to download the new version and will install it then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have just installed v16 of the compiler and the problem does not occur anymore
thanks

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