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 

/DCLVAR

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



Joined: 05 Jul 2006
Posts: 268

PostPosted: Fri Jul 23, 2021 11:37 pm    Post subject: /DCLVAR Reply with quote

The following code generates new error messages in 8.80 when compiling with /DCLVAR. The first message occurs when compiling the module and states that f1 must be declared as External. The second occurs when compiling the program and states that f2 needs to be declared as External. By my understanding of modules, the definition of one function in the module is known to any other function in the same module, and that using External would attempt to declare the function as external to the module. Similarly, my understanding of Use is that it would render an external declaration as redundant at best.

Code:
Module m
Contains
 Function f1()
 Integer :: f1
  f1 = 1
 End Function f1

 Function f2()
 Integer :: f2
  f2 = f1()
 End Function f2
End Module m

Program p
 Use m, Only: f2
 Print*, f2()
End Program p
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Jul 24, 2021 7:46 am    Post subject: Reply with quote

Simon

I will aim to take a look at this on Monday.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon Jul 26, 2021 9:34 am    Post subject: Reply with quote

I am sorry about this. It is an unfortunate regression that has now been fixed for the next release of FTN95.

In the meantime /DCLVAR will give a false error report when used with code containing module functions.

/DCLVAR is an option that was inherited from FTN77. It imples IMPLICIT NONE and also faults code that calls an external subprogram that is not explicitly declared as EXTERNAL.

/DCLVAR works correctly for FTN77 but for FTN95 it was only faulting subroutines and not functions.
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