- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was brought to my attention by a colleague. This code produces a randomly truncated output - and we think that the compiler should detect the interface inconsistency for S.
MODULE M
INTERFACE
MODULE SUBROUTINE S(C)
IMPLICIT NONE
CHARACTER(LEN=:),ALLOCATABLE,INTENT(IN) :: C
END SUBROUTINE S
END INTERFACE
END MODULE M
SUBMODULE (M) SM
CONTAINS
MODULE SUBROUTINE S(C)
IMPLICIT NONE
CHARACTER(LEN=*),ALLOCATABLE,INTENT(IN) :: C
WRITE(*,*) C
END SUBROUTINE S
END SUBMODULE SM
PROGRAM P
USE M
IMPLICIT NONE
CHARACTER(LEN=:),ALLOCATABLE :: STRING
STRING = 'Ha ha!'
CALL S(STRING)
END PROGRAM P
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree - this is an error the compiler should catch. Please submit it to the Intel Online Service Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - I did open a support ticket.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This bug you reported where the compiler failed to detect the interface inconsistency in module/submodule has been fixed. The fix is available as part of PSXE 2020 update 2 (Fortran 19.1.2) that was released last month.
Please check it out!
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