View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Fri Jul 23, 2021 11:37 pm Post subject: /DCLVAR |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Sat Jul 24, 2021 7:46 am Post subject: |
|
|
Simon
I will aim to take a look at this on Monday. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Jul 26, 2021 9:34 am Post subject: |
|
|
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 |
|
|
|