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 

Optional output argument error/bug

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



Joined: 07 Aug 2007
Posts: 29
Location: London or Somerset, UK

PostPosted: Wed Aug 15, 2007 12:34 pm    Post subject: Optional output argument error/bug Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Aug 16, 2007 9:15 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Keith Waters



Joined: 07 Aug 2007
Posts: 29
Location: London or Somerset, UK

PostPosted: Thu Aug 16, 2007 1:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Aug 16, 2007 1:21 pm    Post subject: Reply with quote

The Polyhedron download appears to be out of date.
You should download from the Silverfrost website.
Back to top
View user's profile Send private message AIM Address
Keith Waters



Joined: 07 Aug 2007
Posts: 29
Location: London or Somerset, UK

PostPosted: Thu Aug 16, 2007 1:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
Andrew



Joined: 09 Sep 2004
Posts: 232
Location: Frankfurt, Germany

PostPosted: Thu Aug 16, 2007 2:59 pm    Post subject: Reply with quote

You can grab the latest version from download.com too, the address is:

http://www.download.com/Silverfrost-FTN95/3000-2069_4-10698194.html
Back to top
View user's profile Send private message
Keith Waters



Joined: 07 Aug 2007
Posts: 29
Location: London or Somerset, UK

PostPosted: Thu Aug 16, 2007 5:04 pm    Post subject: Reply with quote

That did the trick. The problem has disappeared. Thanks Paul, thanks Andrew.
Back to top
View user's profile Send private message
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