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 

Incorrect detection of Missing Optional argument

 
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: 560
Location: UK

PostPosted: Sat Jan 29, 2022 2:41 pm    Post subject: Incorrect detection of Missing Optional argument Reply with quote

When compiled with /checkmate turned on (version 8.80), the following code gives a run-time error. "Reference through missing OPTIONAL argument".

(It worked fine with 8.70)

However, the code is correct and works OK with NAG and gfortran compilers.


Code:

module mmm
contains
   subroutine xxx(m, a, b)
      integer m
      double precision, optional :: a(:), b(:)
      print *, m, a
   end subroutine

   subroutine yyy(m, a, b)
      integer m
      double precision, optional :: a(:), b(:)
      ! This call is valid even if a and/or b not provided
      call xxx(m, a, b)
   end subroutine

   subroutine caller(func)
      interface
         subroutine func(m, a, b)
            integer m
            double precision, optional :: a(:), b(:)
         end subroutine
      end interface
      call func(1, (/1.0d0, 1.0d0/))
   end subroutine
end module

program anon
use mmm
call caller(yyy)
end

_________________
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: 7916
Location: Salford, UK

PostPosted: Sun Jan 30, 2022 8:55 am    Post subject: Reply with quote

Thank you for the bug report which I have logged for investigation.
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: Thu Feb 10, 2022 11:28 am    Post subject: Reply with quote

This regression has now been fixed for 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