|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Mon Nov 09, 2020 11:00 am Post subject: Compiler error with /ISO |
|
|
The following code will not compile with versions 8.61 or 8.66 when /ISO is used.
This is a short demonstration, extracted from a larger code where /ISO is required to ensure that SIZE returns a default integer (in line with the Fortran standard) rather than a 64 bit integer.
Code: |
module mmm
type y_t
integer :: n
end type y_t
type x_t
integer :: m
type (y_t), pointer :: y(:) => null()
end type x_t
contains
subroutine create
type(x_t), pointer :: x(:)
allocate(x(1))
allocate(x(1)%y(1))
end subroutine create
end module mmm
|
The compiler error is:
*** '@' found after Alloc where a comma was expected.
*** Unexpected '@' in expression.
This compiles correctly with an older version of the compiler (7.2).
If I make a small change to the code it doesn't compile with or without using /ISO, with a different error message:
*** Alloc@1 is an array, so must have bounds specified in the ALLOCATE statement
*** '<NUL>' found where ')' was expected
Code: |
module mmm
type y_t
integer :: n
end type y_t
type x_t
integer :: m
type (y_t), pointer :: y(:) => null()
end type x_t
contains
subroutine create
type(x_t), pointer :: x(:)
allocate(x(1))
x(1)%m = 1
allocate(x(1)%y(x(1)%m))
end subroutine create
end module mmm
|
_________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Mon Nov 09, 2020 1:43 pm Post subject: |
|
|
Thank you for the feedback.
This failure appears in v8.66 but not in my developers' version. So the problem will be resolved in the next release of FTN95. |
|
Back to top |
|
|
davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Wed Dec 30, 2020 7:24 pm Post subject: |
|
|
This test case is working now in 8.70.
Thanks Paul. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|
Back to top |
|
|
|
|
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
|