View previous topic :: View next topic |
Author |
Message |
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Tue Jul 27, 2021 3:01 am Post subject: SEQUENCE attribute error message |
|
|
The following code consists of two modules and a program:
Code: | Module m1
Type t
Sequence
Integer :: j
End Type t
End Module m1
Module m2
Contains
Function f(i, d)
Use m1
Integer :: f
Integer, Intent(In) :: i
Type(t), Intent(In), Optional :: d
f = 0
Return
End Function f
End Module m2 |
Code: | Program p
Use m2
Print*, f(1)
End Program p |
If the modules are stored in a different file from the program the following compilation error message is issued:
Quote: | error 634 - Passing an argument of a derived type, such as Entity[0], requires the type have the SEQUENCE attribute |
which seems spurious, in part because derived-type t is actually given the SEQUENCE attribute, but also because the program does not even call the function with a derived-type argument anyway.
The error message disappears if:
1. the two modules are combined, while being kept in a separate file
2. everything is kept in one file
I am running FTN95 version 8.70, but am pretty sure the same problem occurs in 8.80. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jul 27, 2021 6:45 am Post subject: |
|
|
Simon
Thank you for the bug report. The failure goes back to at least v4.90 and probably has been there since the outset.
You can probably use /ignore 634 as a temporary work-around. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Jul 27, 2021 9:24 am Post subject: |
|
|
This has now been fixed for the next release of FTN95. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
simon
Joined: 05 Jul 2006 Posts: 268
|
Posted: Tue Jul 27, 2021 2:55 pm Post subject: |
|
|
Many thanks Paul. Using IGNORE 634 does avoid the problem for now. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|