View previous topic :: View next topic |
Author |
Message |
Trondheimer
Joined: 01 Mar 2008 Posts: 3 Location: Norway
|
Posted: Tue Mar 04, 2008 10:37 am Post subject: Recursive procedure - the INTENT attribute |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Thu Mar 06, 2008 1:51 pm Post subject: |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Mar 17, 2008 4:54 pm Post subject: |
|
|
This regression has now been fixed for the next release. |
|
Back to top |
|
|
|