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 

Recursive procedure - the INTENT attribute

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



Joined: 01 Mar 2008
Posts: 3
Location: Norway

PostPosted: Tue Mar 04, 2008 10:37 am    Post subject: Recursive procedure - the INTENT attribute Reply with quote

Given the following straight forward recursive subroutine:

RECURSIVE SUBROUTINE fakultet_sub( n, fak )
IMPLICIT NONE
INTEGER, INTENT( IN ) :: n
INTEGER, INTENT( OUT ) :: fak
INTEGER :: resultat
IF ( n == 0 ) THEN
fak = 1
ELSE
CALL fakultet_sub( n - 1, resultat )
fak = n * resultat
END IF
END SUBROUTINE fakultet_sub

The compiler (version 5.10) gives up with the following rather curious message:

fakultet_sub.F95(9) : error 831 - This expression cannot receive a value, in the call to FAKULTET_SUB, with argument 1 ('FAK') which has been declared as INTENT(OUT)

This is obviously a compiler error. It must have been introduced with version 5.10.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Mar 06, 2008 1:51 pm    Post subject: Reply with quote

I can confirm that this is a bug and a regression.
We will investigate the matter.
Unfortunately a fix will not be ready for the impending release.

In the meantime it is necessary to use /ignore 831 on the command line.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 17, 2008 4:54 pm    Post subject: Reply with quote

This regression 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