replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Procedure arguments with /CHECK
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 

Procedure arguments with /CHECK

 
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: 299

PostPosted: Sun Mar 03, 2013 1:21 pm    Post subject: Procedure arguments with /CHECK Reply with quote

The following code gives an incorrect error message when compiled and run with /CHECK

Code:
MODULE m1
CONTAINS
 FUNCTION f()
  INTEGER :: f
  f=0
 END FUNCTION f
END MODULE m1

MODULE m2
CONTAINS
 SUBROUTINE s (g)
  INTEGER, EXTERNAL :: g
  PRINT *, g()
 END SUBROUTINE s
END MODULE m2

WINAPP
PROGRAM p
 USE m1
 CALL s (f)
END PROGRAM p
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Apr 09, 2013 3:54 pm    Post subject: Reply with quote

I have logged this for investigation.
Back to top
View user's profile Send private message AIM Address
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Tue Apr 09, 2013 5:27 pm    Post subject: Reply with quote

But s is in m2 and isn't in m1.

Therefore s is being treated as an EXTERNAL subroutine and you should get a run time errror _s not found with that code.

I think the code simon should have posted is this (I have added a missing USE statement). This generates the run-time error with /CHECK Wink .

Code:

MODULE m1
CONTAINS
 FUNCTION f()
  INTEGER :: f
  f=0
 END FUNCTION f
END MODULE m1

MODULE m2
CONTAINS
 SUBROUTINE s (g)
  INTEGER, EXTERNAL :: g
  PRINT *, g()
 END SUBROUTINE s
END MODULE m2

WINAPP
PROGRAM p
 USE m1
 USE m2
 CALL s (f)
END PROGRAM p

_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Mar 12, 2014 8:26 pm    Post subject: Reply with quote

This bug has now been fixed for the next release.
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