- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using Intel XE 16 Update 3, the following code compiles without error. It looks as if the USE statement in the first procedure interface is visible to the second interface - I am not sure if this is as expected or if it is a bug.
MODULE M1 IMPLICIT NONE TYPE T INTEGER :: I END TYPE T END MODULE M1 MODULE M2 IMPLICIT NONE INTERFACE MODULE SUBROUTINE S1(V) USE M1 TYPE(T) :: V END SUBROUTINE S1 MODULE SUBROUTINE S2(W) TYPE(T) :: W END SUBROUTINE S2 END INTERFACE END MODULE M2
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This sounds vaguely familiar. Let me look into it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Definitely a bug. It's sort of like another issue we saw earlier, but not the same. Escalated as issue DPD200413983.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you fix it, can you make it optionnal ?
Otherwise I will have to go to many of my programs and add the USEs in many subroutines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
jmloriot, no - it won't be optional. But maybe you misunderstand the issue here. I think this problem is related to the use of submodules (that's what MODULE SUBROUTINE is doing here.) Can you provide an example of what you're doing now that you think will break?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@jmloriot #6. If you use submodules the interfaces will self check with probably only minimal changes to your code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's even better to not use INTERFACE at all for Fortran code except when using submodules. But, yes, "interface to self" is not allowed by the standard and we properly diagnose it.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page