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 

Compiler error with /ISO

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



Joined: 17 Jul 2009
Posts: 558
Location: UK

PostPosted: Mon Nov 09, 2020 11:00 am    Post subject: Compiler error with /ISO Reply with quote

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


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

PostPosted: Mon Nov 09, 2020 1:43 pm    Post subject: Reply with quote

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
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