Silverfrost Forums

Welcome to our forums

Recursive procedure - the INTENT attribute

4 Mar 2008 9:37 #2879

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.

6 Mar 2008 12:51 #2893

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.

17 Mar 2008 3:54 #2933

This regression has now been fixed for the next release.

Please login to reply.