View previous topic :: View next topic |
Author |
Message |
Keith Waters
Joined: 07 Aug 2007 Posts: 29 Location: London or Somerset, UK
|
Posted: Wed Aug 15, 2007 12:34 pm Post subject: Optional output argument error/bug |
|
|
I’m getting the following run-time error in one of my Win32 programs.
*** Error 14, Attempt to alter an actual argument that is a constant, an expression, an INTENT(IN) argument, or a DO variable.
I’ve constructed a small program that demonstrates the error and consists of a Main and a Module as follows.
Code: | C ------------------------------------------------------------
C DEMO.FOR
PROGRAM DEMO
USE Calc
CALL DibDob() !<<<<<< Line 13
PRINT *, 'Demo program has run'
END
! -----------------------------------------------------------
! CALC.F90
MODULE Calc
PUBLIC :: DibDob
CONTAINS
! ----------------------------------------------------------
SUBROUTINE DibDob (lVar) !<<<<<< Line 17
LOGICAL, OPTIONAL, INTENT(OUT) :: lVar
IF (PRESENT(lVar)) lVar = .TRUE.
END SUBROUTINE
END MODULE
|
I’m using a recently downloaded FTN95 Personal Edition with the options /ISO /IMPLICIT_NONE /NO_SCALAR_TO_ARRAY /RESTRICT_SYNTAX /CHECKMATE /BRIEF and linking with SLINK. The run-time error information is as follows (I’ve flagged the offending lines in the above code).
CALC!DIBDOB - in file calc.f90 at line 17 [+003c]
main - in file demo.for at line 13 [+003b]
The problem seems to be with the OPTIONAL argument of INTENT(OUT). Can anyone see why this causes the error?
Keith |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Aug 16, 2007 9:15 am Post subject: |
|
|
This bug has already been fixed.
It is not a recent fix so the current release (5.10) should be OK.
Make sure that you are also using the latest salflibc.dll (use saldiag.exe). |
|
Back to top |
|
|
Keith Waters
Joined: 07 Aug 2007 Posts: 29 Location: London or Somerset, UK
|
Posted: Thu Aug 16, 2007 1:16 pm Post subject: |
|
|
Ah – well, there must be something wrong with the download from the Polyhedron web site since I downloaded FTN95 only a few days ago. As I reported earlier, the compiler is declared as version 5.10 on the web site but prints version 4.9.0 on the console when I run it.
I located salflibc.dll with the search tool, saldiag.exe. The dll is Version 7.11.10.11. Is this the correct version? Also, I checked my system to make sure there is no old version that was being picked up. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Thu Aug 16, 2007 1:21 pm Post subject: |
|
|
The Polyhedron download appears to be out of date.
You should download from the Silverfrost website. |
|
Back to top |
|
|
Keith Waters
Joined: 07 Aug 2007 Posts: 29 Location: London or Somerset, UK
|
Posted: Thu Aug 16, 2007 1:45 pm Post subject: |
|
|
Which seems to be down (http://silverfrost.com/ or http://www.silverfrost.com/ - both fail). I’m not having much luck lately. |
|
Back to top |
|
|
Andrew
Joined: 09 Sep 2004 Posts: 232 Location: Frankfurt, Germany
|
|
Back to top |
|
|
Keith Waters
Joined: 07 Aug 2007 Posts: 29 Location: London or Somerset, UK
|
Posted: Thu Aug 16, 2007 5:04 pm Post subject: |
|
|
That did the trick. The problem has disappeared. Thanks Paul, thanks Andrew. |
|
Back to top |
|
|
|