forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

generic interface

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
simon



Joined: 05 Jul 2006
Posts: 163

PostPosted: Wed May 27, 2020 3:24 pm    Post subject: generic interface Reply with quote

I reported the following code to NAG as a suspected error, since their compiler was complaining about the two subroutines s1 and s2 being indistinguishable.
Code:
Module m
 Interface s
   Module Procedure s1
   Module Procedure s2
 End Interface s
!
Contains
!
 Subroutine s1 (i, c)
   Integer, Intent(In) :: i
   Character(Len=*), Intent(In) :: c
   Return
 End Subroutine s1
!
 Subroutine s2 (c, i)
   Character(Len=*), Intent(In) :: c
   Integer, Intent(In) :: i
   Return
 End Subroutine s2
End Module m

The code compiles without an error in FTN95. However, NAG indicated that the code is incorrect because
Code:
Call s (i=i, c=c)

would be ambiguous since the ordering of the arguments does not matter even though the arguments are not optional. So perhaps FTN95 should issue a compilation error message?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 6334
Location: Salford, UK

PostPosted: Thu May 28, 2020 8:10 am    Post subject: Reply with quote

Thank you for the feedback. You are right. FTN95 does not fault this even when using /ISO.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group